In SuiteScript 2.1, how do I add a SELECT field to...
# ask-stanley-ai
a
In SuiteScript 2.1, how do I add a SELECT field to the form in beforeLoad, which will have the same options as the Task Status field? What value should I use for the "source" parameter of the form.addField function call?
c
AI generated answer (using internal Slack threads):
In SuiteScript 2.1, to add a SELECT field to the form in beforeLoad, which will have the same options as the Task Status field, you can use the
form.addField
function. The "source" parameter of the
form.addField
function call should be set to the internal ID of the Task Status field. Here is a sample code snippet:
Copy code
javascript
var field = form.addField({
    id: 'custpage_status',
    type: serverWidget.FieldType.SELECT,
    label: 'Task Status',
    source: 'taskstatus' // This is the internal ID of the Task Status field
});
Please note that the source parameter should be the internal ID of the record type that you want to use as the source for your select field. In this case, 'taskstatus' is the internal ID for the Task Status field in NetSuite. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.860567927
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.846122146
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.845182896
Please provide your feedback on this answer.