Require fields on a form

When Required Form Fields is activated, an administrator can designate specific fields on a form as required (protected) fields. Users cannot hide required fields when they personalize the form.

If present on a form, only an administrator can remove required fields. When you configure a form, required fields appear in a gray color and have a tooltip indicating they are required. Required fields are defined in the Required Form Fields [sys_ui_element_required] table.

The expected (although not the only) use case for this feature is as part of a delegated administration scheme. For example, you can grant branch offices the rights to modify forms by granting the personalize_form role, but not allow them to remove certain fields which are critical to overall business processing.

Activate required form fields

You can activate the Required Form Fields plugin (com.snc.required_form_fields) if you have the admin role. This plugin activates related plugins if they are not already active.

Before you begin

Role required: admin

Procedure

  1. Navigate to System Definition > Plugins.
  2. Right-click the plugin name on the list and select Activate/Upgrade.

    If the plugin depends on other plugins, these plugins are listed along with their activation status.

  3. (Optional) If available, select the Load demo data check box.

    Some plugins include demo data—sample records that are designed to illustrate plugin features for common use cases. Loading demo data is a good policy when you first activate the plugin on a development or test instance. You can load demo data after the plugin is activated by repeating this process and selecting the check box.

  4. Click Activate.

Define required fields

You can specify which form fields are required in forms. This action prevents users with the personalize_form role from removing the field by configuring the form layout.

Before you begin

Activate the Required Form Fields plugin before you perform this task.

Role required: admin

Procedure

  1. Navigate to sys_properties.list.
  2. Locate the property named glide.ui.form.enforce_required_fields and make sure it is set to true.
  3. Navigate to System UI > Required Form Fields.
  4. Click New.
  5. Select the table and field, and then select the Required check box.
    The following example sets the Short description field on the Incident form to be required.
    Required form field
    If you decide later that you do not want to make the field required, clear the Required check box. This action is preferable to deleting the record.
  6. Click Submit.

Result

If the table specified has extension tables, then the Required Form Field record applies to forms of all extended tables. For example, if an administrator specifies that the Short description field is required for the Task table, then this configuration applies to the Incident form, Change Request form, Problem form, and so on.

An extended table can override the base table Required Form Field rule. For example, if the Short description field is required for the Task table, but not required for the Incident table, it is required for all Task tables except Incident.