Mandatory Data in Web UI

Mandatory validation means a value is required. This setting is available on an attribute, on a reference, or from within a workflow. For example, for products, setting the 'Accessory' reference type as mandatory ensures that the product cannot be approved until an accessory is selected.

Important: Careful testing is recommended when using mandatory validation.

  • A mandatory setting on an attribute or reference in workbench is applied in addition to other data validation settings applied at any level in the Web UI.

    For example, if an attribute is defined as mandatory in the workbench, but a business condition is configured to set that same attribute to be read-only or hidden in the Web UI, then in the Web UI, a product displaying that attribute shows an error with no way to address the error.

  • A user cannot save an object if a mandatory value has been removed from a parameter; however, if the parameter has never had a value, the object can be saved.

  • Product objects cannot be approved until all mandatory values are added.

Mandatory objects, like the 'Ownership' attribute in the image below, are identified by:

  • An asterisk (*) to the left of the attribute name.

  • A red background color if the user clicks out of the field without adding a value.

  • The default message (shown above) or a custom message configured via a JavaScript business condition.

    Note: Any custom messages configured to display when a JavaScript business condition is applied will not override the default message that displays for mandatory attributes and references when defined on the object itself. If the mandatory setting is configured in workbench or Web UI, it has priority over the business condition "mandatory.setMandatory("custom message", node, attrHome.getAttributeByID("AttributeID"));".

Recommended Use

If an attribute or reference should always be mandatory, use the Web UI designer or other validation options to set the mandatory requirement on the object permanently.

To create custom validation messages without using business rules, refer to the Custom Validation Error Messages topic in the System Setup documentation or the Reference Help Text in the Web UI topic in the Web User Interfaces documentation.

Mandatory validation can be set in the Web UI as defined in the linked topics below.

  • Mandatory on Attributes

    In the Web UI, attributes can be made mandatory on a screen-by-screen basis to ensure that they are populated on particular screen(s). This approach is especially advantageous for individual screens, allowing attributes to be mandatory on one screen while remaining optional on another. This can be achieved, for example, through visual indicators prompting users to enter required values or through mandatory attribute population, which enforces the setting and prevents users from approving and/or processing an object until all required values are provided.

    For details on setting validation on attribute objects in the Web UI, refer to the Mandatory Attributes in Web UI section below and for setting attributes as mandatory in the workbench, refer to the Mandatory Attributes topic in the System Setup documentation.

  • Mandatory on References

    Mandatory validation can be set on mandatory reference types linking a source object to a target object. This ensures that the source object cannot be approved until a mandatory reference type has been selected for the object.

    For more information about validation set on reference types, refer to the Reference Type - Advanced topic in the System Setup documentation.

  • Mandatory in Business Conditions

    A business condition is needed when an attribute or a reference requires dynamic mandatory validation. This dynamic setting makes the requirement dependent on another setting within the node.

    In such scenarios, a mandatory bind allows the execution of a business condition that only sets selected attributes and references as mandatory as needed. This condition validates the data for the attribute as the user enters it. If the entered values fail to meet the requirements of the rule, the user is notified with a warning message.

    For details on mandatory binds used in business conditions, refer to the Configuring Business Conditions in Web UI topic in the Web User Interfaces documentation and the Mandatory Bind topic (for use with JavaScript business rules) in the Resource Materials online help documentation.

  • Mandatory on Workflow Transitions

    When certain attributes are mandatory for a state or a transition within a workflow, validation can be established on workflow transitions. Mandatory validation on workflow transitions serves to prevent users from continuing in the workflow until they have provided the required values. This validation can be configured differently for various transitions within the workflow.

    For more information about validation in workflows, refer to Workflow Mandatory Attributes in Web UI topic in the Web User Interfaces documentation and the Mandatory Attributes and References in Workflows topic in the Workflows documentation.

The selection between the above static and dynamic mandatory validation methods depends on the desired outcome. Static mandatory settings for attributes and references ensure completion on designated screens, while dynamic mandatory validation allows for flexible, changing mandatory requirements. When data input necessitates specific data to become mandatory, it is recommended to use a business condition to enable dynamic mandatory validation. Conversely, when data input does not affect the mandatory state, it is advisable to use static mandatory settings either in the Web UI Designer or on the attribute itself.

Use of Business Conditions in the Web UI versus in Workflows

By adding business conditions to transitions in workflows, it is possible to prevent users from submitting. When a user tries to submit and submission is prevented by a business condition in the workflow, the user is presented with errors and warnings from the business condition, which the user can dismiss in the Notification Panel. For more information, refer to the Mandatory Attributes and References in Workflows topic in the Workflows documentation and the Workflow Mandatory Attributes in Web UI topic in the Web User Interfaces documentation.

It is recommended to apply business conditions to workflows due to their governance capabilities. By also adding business conditions to the Web UI configuration, errors and warnings can be presented to the user as screens are loaded, and these business conditions are reevaluated in real time as the user modifies data. For details, refer to the Configuring Business Conditions in Web UI topic in the Web User Interfaces documentation.

Solution Enablement Use Case

For additional considerations when configuring data validation to support a customer and supplier MDM environment, refer to the Controlling Data Validity topic in the Solution Enablement: Customer & Supplier MDM documentation.

Mandatory Attributes in Web UI

Attributes can be made mandatory in the Web UI on a screen-by-screen basis, providing a visual indicator that data should be populated. Optional enforcement of the setting prevents users from saving or submitting data until mandatory attributes are populated. This provides a more granular level of enforcement than approval-mandatory attributes, and when configured for single-use screens, is considered a process-based mandatory setting. However, when screens are shared, this option has larger-scale implications that should be considered.

Important: Be aware that an attribute may be marked as mandatory on one screen, but not on another. Therefore, even when mandatory attribute population is enforced on a particular screen, that does not equate to an approval mandatory setting.

Attributes can also be set as mandatory in workbench as defined in the Mandatory Attributes topic of System Setup documentation.

Visual Indicators

Mandatory attributes shown in a Web UI Node Editor display in black text preceded by a red asterisk.

To configure attributes to be mandatory, check the Mandatory parameter in any Attribute Value or Attribute Value Group component.

This setting alone does not enforce that the attribute must be populated; it provides a visual indicator to prompt the user to provide a value. To enforce population of the value, additional configuration is required, which is described in the 'Enforcement of Mandatory Attributes' section below.

Mandatory Attributes for Headers

Column headers in a Web UI Node List can be made to display as mandatory through a configuration setting in the designer. Mandatory headers display in bold text followed by a red asterisk.

To configure headers in a tabular view to display as mandatory, set the Mandatory parameter on the header component to 'VisuallyMandatory.'

Headers that display as mandatory indicate to a user that cells under the header should contain a value, but this setting does not subject the column to validation enforcement. This means that, for example, even if the parameter 'Enforce Validity' (defined below) is checked on the 'Save' button, empty cells under mandatory headers will not trigger an error upon saving.

More information on the Attribute Value Component and Attribute Value Group Component is available in this documentation.

Enforcement of Mandatory Attributes

Important: The information that follows about the enforcement of mandatory attributes in the Web UI is applicable regardless of how an attribute is set to mandatory (via workbench or during the Web UI screen-by-screen configuration).

To enforce that mandatory attributes are populated on the selected screen, the attributes must first be set as mandatory (as described above). In addition, any actions available on the screen that should enforce the population of mandatory attributes must have the Enforce Validity parameter selected. Typically this is applied to Save, Submit, or Approve actions. When Enforce Validity is selected on an action, the action button is not enabled until all mandatory attributes are populated.

Important: Review the considerations below to determine if preventing an action is truly desired before checking the Enforce Validity parameter.

Considerations

  • When Enforce Validity is applied to the Save action, users cannot save any data until all mandatory attributes are populated.

  • When Enforce Validity is applied to shared screens, if the same screen is reused for both onboarding and maintenance of objects, different data may be required at different times. However, both the mandatory and enforcement settings are applied to the screen itself, not to particular instances where the screen is used, and therefore it cannot be differentiated to make an attribute mandatory in only one of the cases.

    Mandatory enforcement on shared screens can be managed by creating separate Web UI screens for each process, or by having the screens tied to workflows and using the workflow mandatory settings. For more information, refer to the Mandatory Attributes and References in Workflows topic in the Web User Interfaces documentation.