darrenhillconsulting
10/19/2024, 2:23 PMCeligo AI
10/19/2024, 2:25 PMAI generated answer (using internal Slack threads):In a Suitelet, you can make a select field in a sublist mandatory by using the
isMandatory
property of the field. This can be done when you create the sublist field (column). Here is a simple example:
javascript
var sublist = form.addSublist({
id: 'customsublist',
type: serverWidget.SublistType.LIST,
label: 'Custom Sublist'
});
var selectField = sublist.addField({
id: 'customselect',
type: serverWidget.FieldType.SELECT,
label: 'Custom Select'
});
selectField.isMandatory = true;
In this example, customselect
is the ID of the select field in the sublist customsublist
. The isMandatory
property is set to true
, which makes this field mandatory.
However, please note that this will make the entire column mandatory. There is no way in NetSuite to set columns mandatory by line.
If you want to enforce the mandatory condition on a line-by-line basis, you might need to use a client script with the validateLine
function to check if the field is filled in before allowing the line to be added.
******
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:25 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844933391
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840236247
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839241087
Celigo AI
10/19/2024, 2:25 PMCeligo AI
10/19/2024, 2:35 PM