Modules
Objects/Functions
SuiteScript 2.0
{Field}.getSelectOptions({filter: {string},filteroperator: {string}})
N/ui/serverWidget Module
Field.getSelectOptions()
Method Description:
Obtains a list of available options on a select field.
The internal ID and label of the options for a select field as name/value pairs is returned.
The first 1,000 available options are returned.
If you attempt to get select options on a field that is not a select field, if it is a popup select field, or if you reference a field that does not exist on the form, null is returned.
A call to this method may return different results for the same field for different roles.
Returns:
Object[]
Supported Script Types:
SuiteScript 2.0 Suitelet Script Type and SuiteScript 2.0 User Event Script Type (beforeLoad(scriptContext))
Governance:
None
Module:
N/ui/serverWidget Module
Since:
2015.2
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=Field.getSelectOptions(options)
Example:
// Code Example 1
//Add additional code
//...
var form = serverWidget.createForm({
title : 'Simple Form'
});
var selectField = form.addField({
id : 'custpage_selectfield',
type : serverWidget.FieldType.SELECT,
label : 'Select'
});
selectField.addSelectOption({
value : 'a',
text : 'Albert'
});
var options = field.getSelectOptions({
filter : 'a',
filteroperator: 'startswith'
});
//...
//Add additional code
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4335162417.html