MobileGlideForm (g_form) - hasField(String fieldName)

Determines if a field is present on the form.

Present means that it can be shown, not that it is visible.

Table 1. Parameters
Name Type Description
fieldName String The field to look for.
Table 2. Returns
TypeDescription
BooleanTrue if the field is present on the form; false, if it is not. On the form means that the field is part of g_form. It could still be hidden, read-only, mandatory, or invalid.

This example makes the assigned_to field mandatory if the assignment_group field is on the form.

if (g_form.hasField('assignment_group'))
      g_form.setMandatory('assigned_to', true);