Field.addSelectOption(options)
Method Description |
Adds the select options that appears in the dropdown of a field.
Important:
After you create a select or multi-select field that is sourced from a record or list, you cannot add additional values with |
Returns |
void |
Supported Script Types |
Suitelets User event scripts -beforeLoad entry point For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
The internal ID of this select option. |
2015.2 |
|
string |
required |
The label for this select option. |
2015.2 |
|
Boolean |
optional |
If set to |
2015.2 |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/ui/serverWidget Module Script Samples.
//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 : '',
text : ''
});
selectField.addSelectOption({
value : 'a',
text : 'Albert'
});
...
//Add additional code