Friday, June 14, 2019

Set Radio Buttons Mandatory by Script

The method nlobjField.setMandatory(true) is not honored for fields of type radio. For example, when creating a field of type radio in a Suitelet's form and applying this method, the form can be submitted even without providing a value for the Radio Button.

In order to ensure a field of type radio is mandatory, it is necessary to provide a default value for the field. This can be done by using nlobjField.setDefaultValue(value). This way a radio button is selected by default and the user can only change the selection to a different option, but not deselect all options.

No comments:

Post a Comment