Aaron McCausland
06/24/2025, 6:45 PMCeligo AI
06/24/2025, 6:45 PMAI generated answer (using internal Slack threads):To clear all options from a list/record field in SuiteScript 2.1, you can use the
removeSelectOption
method. However, this method only works for fields that are not sourced. If the field is sourced, you cannot remove select options from it.
Here is an example of how you can use the removeSelectOption
method:
javascript
function pageInit(scriptContext) {
var myRecord = scriptContext.currentRecord;
var newField = myRecord.getField({fieldId: 'custpage_contactfield'}); // field added through a UE BL script
newField.removeSelectOption({value: null});
}
In this example, the removeSelectOption
method is used to remove the select option with a null value from the 'custpage_contactfield' field.
If you want to clear all options from a sourced field, you may need to hide/disable the standard field and add your own scripted field that you can add or remove options from.
******
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
06/24/2025, 6:45 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.808792412
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.796082854
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.795116603
Celigo AI
06/24/2025, 6:45 PMAaron McCausland
06/24/2025, 6:47 PM