NS AdminA
03/21/2025, 6:53 PMError setting display for ${fieldId}:
, error);
}
}
function openEmployeeSelection(attendeeQty, lineIndex) {
let suiteletUrl = url.resolveScript({
scriptId: 'customscript_employee_selection_suitelet',
deploymentId: 'customdeploy_employee_selection_suitelet',
params: {
attendeeQty: attendeeQty,
lineIndex: lineIndex
}
});
window.open(suiteletUrl, '_blank', 'width=600,height=400');
}
return {
pageInit: pageInit,
fieldChanged: fieldChanged,
validateLine: validateLine
};
});Celigo AI
03/21/2025, 6:53 PMAI generated answer (using internal Slack threads):To modify the script so that it highlights rows when
custcol_attendee_qty
is populated, you can use the setHighlight
method provided by NetSuite. This method allows you to highlight a sublist line in the user interface.
Here is a sample of how you can use it:
javascript
function fieldChanged(context) {
let rec = currentRecord.get();
let sublistId = context.sublistId;
let fieldId = context.fieldId;
// Handle attendee quantity and suitelet logic
if (sublistId === 'expense' && fieldId === 'custcol_attendee_qty') {
let attendeeQty = rec.getCurrentSublistValue({
sublistId: 'expense',
fieldId: 'custcol_attendee_qty'
});
if (attendeeQty > 0) {
// Highlight the line
rec.selectLine({
sublistId: 'expense',
line: context.line
});
rec.setCurrentSublistValue({
sublistId: 'expense',
fieldId: 'custcol_attendee_qty',
value: attendeeQty
});
rec.commitLine({
sublistId: 'expense'
});
}
}
}
In this example, when the custcol_attendee_qty
field is changed, the script checks if the value is greater than 0. If it is, it selects the line, sets the value, and then commits the line. This will highlight the line in the user interface.
Please note that this is a simplified example and you may need to adjust it to fit your specific needs. Also, remember to test thoroughly before deploying to a live environment.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
03/21/2025, 6:53 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.867392421
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.866300642
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.865835488
Celigo AI
03/21/2025, 6:53 PMAaron McCausland
03/24/2025, 10:23 PM