Can you add options to a custom list through Suite...
# ask-stanley-ai
p
Can you add options to a custom list through SuiteScript?
c
AI generated answer (using internal Slack threads):
Yes, you can add options to a custom list through SuiteScript. There are two ways to do this: 1. Treat the custom list like a normal custom record and create a new record. Use the script ID of the custom list as the record type. 2. Treat the custom list type as the record and modify the values sublist like you do in the UI. Use 'customlist' as the record type and the internal ID of the custom list type as the ID. Here is a code sample that was provided in the threads:
Copy code
javascript
let stageField = form.addField({
    id: 'custpage_stage',
    label: 'Stage',
    type: serverWidget.FieldType.SELECT,
});

stageField.addSelectOption({
    value: "all",
    text: "-ANY-",
    isSelected: true
});

stageField.addSelectOption({
    value: "LEAD",
    text: "Lead",
    isSelected: false
});

stageField.addSelectOption({
    value: "PROSPECT",
    text: "Prospect",
    isSelected: false
});

stageField.addSelectOption({
    value: "CUSTOMER",
    text: "Customer",
    isSelected: false
});
****** 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.862243652
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.861938357
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.853881836
Please provide your feedback on this answer.
a
yes