Marks the specified field as required, if it is not already marked as such. It updates the field and the label appropriately.

Note: This method can be used only on a field that is set in SBM Composer or SBM Application Administrator to be not required, not read-only, and in a field section that is visible on a form. It is used with the MakeFieldOptional method to dynamically change the required or optional state of a non-required field on a form.


Name Type Description
fieldName String The name of the field.
bShowIfHidden (optional) Boolean Show the field if it was hidden by the HideField method. The default value is true.

Return Value

Result Value


This example marks the Unit Price field as required:

MakeFieldRequired("Unit Price");

This example marks the Unit Price field as required but does not show it if it is hidden:

MakeFieldRequired("Unit Price", false);