Skip to content

isMandatory

Updated pdexter 2023-12-15

Checks if a field on the document is set as mandatory.

(client-side function)

Syntax

ft3.isMandatory(field-name)

Part Description
field-name name of the field on the document

Returns

Boolean value indicating whether the field is mandatory (true) or not (false).

Example

var ft3 = ntf.scope;

// Check if the 'dateOfBirth' field is mandatory
var isDateOfBirthMandatory = ft3.isMandatory('dateOfBirth');
ntf.logger.info('Date of Birth Mandatory:', isDateOfBirthMandatory);

// Check and log the mandatory status of the 'emailAddress' field
var isEmailAddressMandatory = ft3.isMandatory('emailAddress');
ntf.logger.info('Email Address Mandatory:', isEmailAddressMandatory);

Note

To check the mandatory status of fields on a parent document when a child document is open, precede the field-name with parentDoc, e.g., parentDoc.firstName.

To check the mandatory status of fields on a child document when a child document is open, precede the field-name with childDoc, e.g., childDoc.firstName.