NS AdminA
03/04/2025, 5:49 PMCeligo AI
03/04/2025, 5:49 PMAI generated answer (using internal Slack threads):The script doesn't work because the
addSelectOption
method is not available for the Field
object in SuiteScript. Instead, you should use the insertSelectOption
method to add options to a select field. Here is how you can do it:
javascript
let field = form.addField({
id: "custpage_myNewList",
type: serverWidget.FieldType.SELECT,
label: "My New List"
});
field.insertSelectOption({value: 1, text: 'Some Value'});
Please note that the insertSelectOption
method inserts a select option at the beginning of the list. If you want to add the option at a specific position, you can use the before
parameter to specify the value of the option before which the new option should be inserted.
******
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/04/2025, 5:49 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.863826931
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.862208545
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.861866951
Celigo AI
03/04/2025, 5:49 PM