In our previous article, New to NetSuite | Understanding SuiteScript 2.x Modules, we explored the SuiteScript Modules and N/record module, New to NetSuite | N/record Module Overview, which is used to interact with records. Now, we will take a closer look at one of the members of N/record: Field.getSelectOptions(options) Method.
The Field.getSelectOptions(options) is a method on the record.Field object. It returns the available choices for a dropdown select, multi-select, or radio field. Each returned option contains the option’s internal value and display text, for example:
[
{ value: 5, text: 'abc' },
{ value: 6, text: '123' }
]
It returns the field option internal ID and label as name/value pairs, must be used only on a record in dynamic mode, has no governance cost, and is supported in client and server scripts.