darrenhillconsulting
10/19/2024, 2:22 PMCeligo AI
10/19/2024, 2:22 PMAI generated answer (using internal Slack threads):To make a SELECT field in a Sublist mandatory, you can use a beforeLoad script in SuiteScript. You can use the form from the scriptContext to get the sublist and from there the field you wish to modify. The field has a
isMandatory
setter that you can use to enforce mandatoriness.
Here is a sample code snippet:
javascript
function beforeLoad(scriptContext) {
if (scriptContext.type !== scriptContext.UserEventType.CREATE)
return;
var form = scriptContext.form;
var sublist = form.getSublist({ id : 'sublist_id' });
var field = sublist.getField({ id : 'field_id' });
field.isMandatory = true;
}
In this code, replace 'sublist_id'
and 'field_id'
with the actual ID of your sublist and field. This will make the field mandatory only when creating a new record.
Please note that this will make the whole column mandatory. There is no way in NetSuite to set columns mandatory by line.
******
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
10/19/2024, 2:22 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840270698
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.838576794
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834216237
Celigo AI
10/19/2024, 2:22 PMDaniel Goldman
10/19/2024, 5:38 PM