Marks the specified field as optional (that is, not 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 the form. It is used with the MakeFieldRequired method to dynamically change the optional or required state of a non-required field on a form. This method does not apply to fields originally set as required on a workflow or transition level. It applies only to fields set as required with the MakeFieldRequired method.


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

Return Value

Result Value


This example marks the Unit Price field as required:

MakeFieldOptional("Unit Price");

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

MakeFieldOptional("Unit Price", false);