mg2017
03/01/2024, 3:37 PMconst notcField = currentRecord.getField({
fieldId: 'custbody_notc'
});
log.debug({title: "NOTC Defintion", details: notcField});
const selectOptions = notcField.selectOptions;
if (!selectOptions || selectOptions.length === 0) {
if (!natureOfTransactionCode) {
dialog.alert({
title: intrastatMessage,
message: 'Value Required',
});
return false;
}
}
eblackey
03/01/2024, 3:40 PMmg2017
03/01/2024, 3:43 PMmg2017
03/01/2024, 3:45 PMeblackey
03/01/2024, 3:54 PMeblackey
03/01/2024, 3:56 PMerictgrubaugh
03/01/2024, 4:35 PMField
instance. You use Record.getValue(). I believe an empty Select field will return null
erictgrubaugh
03/01/2024, 4:39 PMcr
is the N/currentRecord
module, so get()
returns a CurrentRecord
instance (similar API to a Record
instance), and partner
is an empty dropdown field on the record.erictgrubaugh
03/01/2024, 4:40 PMconst notc = yourRecord.getValue({ fieldId: 'custbody_notc' })
if (!notc) {
// the field is empty
}
mg2017
03/01/2024, 6:29 PMvvsam
03/01/2024, 6:39 PMconst selectOptions = notcField.selectOptions;
To:
const selectOptions = notcField.getSelectOptions();
erictgrubaugh
03/01/2024, 8:12 PMYou can use this method only in dynamic mode. For additional information about dynamic mode, see CurrentRecord.isDynamic.
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, null is returned.
A call to this method may return different results for the same field for different roles.
This function returns Type Error if the field is not a supported field for this method.
mg2017
03/01/2024, 9:48 PMStefan Reeder
03/01/2024, 11:38 PMmg2017
03/02/2024, 9:33 AM