https://netsuiteprofessionals.com logo
#suitescript
Title
# suitescript
j

Justin B

04/26/2022, 2:37 AM
Hey, I am using a client script to set a transaction field as mandatory. It seemingly works in that it adds the red asterisk, but then doesn't actually enforce that a field value be selected before the record is saved. Is this expected behavior? Strikes me as odd. Hope this isn't a completely dumb question.
Copy code
var field = currentRecord.getField('custbody_mycustomfield');
field.isMandatory = true;
Thx in advance for any help!
m

michoel

04/26/2022, 4:39 AM
The documentation doesn't actual specify you can use that property as a setter.
Returns
true
if the standard or custom field is mandatory on the record form, or
false
otherwise.
SuiteAnswer # 85631 is more explicit that it's "read-only" and you need to do your own checking in the saveRecord entry point
j

Justin B

04/26/2022, 1:19 PM
Thanks, Michael. I wondered if this was the case