Nour Khaled
01/14/2025, 2:55 PMCeligo AI
01/14/2025, 2:55 PMAI generated answer (using internal Slack threads):To access and manipulate a "Custom List" through SuiteScript, you can treat the custom list as a normal custom record and create a new record. Use the script ID of the custom list as the record type. Here is a general example:
javascript
var record = nlapiCreateRecord('customlist_my_custom_list');
record.setFieldValue('name', 'My New Value');
nlapiSubmitRecord(record);
In this example, 'customlist_my_custom_list' is the script ID of your custom list, and 'My New Value' is the value you want to add to the list.
Alternatively, you can 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.
For adding dynamic values into the custom list in SuiteScript, you can remove the source when creating the list and manually put the values you want in there. If you want to add values to the custom list using SuiteScript in a Suitelet form, you can use the addSelectOption method to add options to a dropdown field. Here is an example:
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
});
In this example, 'custpage_stage' is the ID of your dropdown field, and the addSelectOption method is used to add options to the dropdown.
******
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
01/14/2025, 2:56 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.875874341
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843570352
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84033525
Celigo AI
01/14/2025, 2:56 PM