Remove a select option from certain types of select and multiselect fields.

Field.removeSelectOption(options)

Method DescriptionRemoves a select option from certain types of select and multiselect fields.This method is usable only in select fields that were added by a front-end Suitelet or beforeLoad user event script. The IDs for these fields always have a prefix of custpage.
Returnsvoid
Supported Script TypesClient scriptsFor more information, see SuiteScript 2.x Client Script Type.
GovernanceNone
ModuleN/currentRecord Module
Since2016.2

Note: The options parameter is a JavaScript object.

ParameterTypeRequired / OptionalDescriptionSince
options.valuestringRequiredA string, not shown in the UI, that identifies the option.To remove all options from the list, set this field to null, as follows: ... field.removeSelectOption({ value: null, }); ...2016.2
Errors
Error CodeThrown If
SSS_INVALID_UI_OBJECT_TYPEA script attempts to use this method on the wrong type of field. This method can be used only on select and multiselect fields whose IDs begin with the prefix custpage.

Syntax:

//Add additional code 
...

// Instantiate the field. Note that this method is supported only 
// on fields whose fieldIds have a prefix of custpage. 

var field = call.getField({
    fieldId: 'custpage_select1field'
});


// Remove the appropriate option.

field.removeSelectOption({
    value: 'Option2',
});   

...   
//Add additional code 

Leave a comment

Your email address will not be published. Required fields are marked *