Having a :netsuite: moment here. Basic Question In...
# suitescript
a
Having a netsuite moment here. Basic Question In a User Event Script - Before Submit. Trying to get the label of a dropdown selection Sample of what code looks like
Copy code
const dropdownValue= newRecord.getValue('custentity_dropdown_options')
const dropdownLabel = newRecord.getText('custentity_dropdown_options')
With getText, I get an error message of Invalid API usage. So as per documentation I tried using getSelectOptions which works in dynamic mode with the N/record module
Copy code
newRecord.getField({ fieldId: 'custentity_dropdown_options' }).getSelectOptions()
I am getting getSelectOptions is not a function. How / Is it Possible, to get this seemingly simple piece of information in a beforeSubmit with context.newRecord?
s
I believe in the scenario here, your record is actually a
currentRecord
type not a
record
type.
currentRecord.Field.getSelectOptions()
is only availabe client-side, which is why it is not working. As battk already said, do the search