Require fields on a form

When Required Form Fields is activated, an administrator can designate specific fields on a form as required (protected) fields.

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. Find and click the plugin name.
  3. On the System Plugin form, review the plugin details and then click the Activate/Upgrade related link.

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

    If the plugin has optional features that are not functional because other plugins are inactive, those plugins are listed. A warning states that some files will not be installed. If you want the optional features to be installed, cancel this activation, activate the necessary plugins, and then return to activating the plugin.

  4. (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 also load demo data after the plugin is activated by clicking the Load Demo Data Only related link on the System Plugin form.

  5. 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

You must activate the Required Form Fields plugin before you can 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 checkbox. 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 its base table's Required Form Field rule. For example, if the Short description field is required for the Task table, but not required for the Incident table, iit is required for all Task tables except Incident.