Field.getSelectOptions(options)
Method Description |
Obtains an array of available options on a dropdown select, multi-select, or radio field. The internal ID and label of the field options are returned as name/value pairs.
Important:
You can only use this method on a record in dynamic mode. For additional information about dynamic mode, see record.Record and SuiteScript 2.x Standard and Dynamic Modes. |
Returns |
Object[] This function returns an array in the following format:
This function returns If you attempt to get select options on a field that is not a dropdown select field, such as a popup select field or a field that does not exist on the form, Because the maximum value for the Maximum Entries in Dropdowns settings is 500, the maximum number of options that can be returned by this method is 500.
Note:
A call to this method may return different results for the same field for different roles. |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Object Members |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
The search string to filter the select options that are returned.
Note:
Filter values are case insensitive. |
2015.2 |
|
string |
required |
The following operators are supported:
|
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/record Module Script Samples.
// Add additional code
...
var objRecord = record.load({
type: record.Type.SALES_ORDER,
id: 275
});
var objField = objRecord.getField({
fieldId: 'couponcode'
});
var options = objField.getSelectOptions({
filter : 'C',
operator : 'startswith'
});
//Perform an action with the options array
...
// Add additional code