In MDM Forms are two types of rules available: Standard and Custom. In this article, we cover the use of Standard rules in an MDM Form.
This type of rule consists of the following three parts: Condition type, Condition(s), and Action(s).
The Standard Rule provides you with a simple builder of form interactions with a predefined list of common Conditions and Actions.
You should first select any of the two Condition Types: All or Any.
The Condition Type All means a logical AND, ie, it'll trigger the form rule Actions only if All the Conditions are True. The Condition Type Any means a logical OR, ie, it'll trigger the form rule Actions when Any of the Conditions are True.
You can add Conditions for any of the MDM Fields on the form. The UI Elements dropdown list shows the fields present in the form.
When you select a field from the UI Elements dropdown list, you can select the type of Comparison condition from the dropdown list, and set a Value (if applicable).
In our example, we selected the Employer field from the UI Elements, and select the Is Empty for the Comparison condition which doesn't need a Value.
The available conditions depend on the field type selected, see the below table for the list of options:
|Is Not Empty|
|Less than or Equal to|
|Greater than or Equal to|
From the DCM version 5.3+ that supported the Many-2-Many Reference Objects, pay attention to the difference of the Condition types "Contains"/"Not contains" for the different Reference Objects:
- For One-to-Many Dictionary words it works as string matching with code: ENG match ENGLISH
- For Many-to-Many Dictionary words it matches any code from the common-separated value list: ENGLISH, ARABIC matches ENGLISH or ARABIC, CHINESE etc
- For One-to-Many Reference Objects the condition "Contains" does not work for Numeric values like ID
- For Many-to-Many Reference Objects do not support Numeric values like an ID for "Equal" and "Contains" conditions
To add an action you have to select it from the Action dropdown list.
Then you have to select the UI Element, Section, or Container to which the Form Rule should apply the Action.
All Actions work for UI Elements (fields), Containers, and Sections but in different ways. See the list below on how it works:
- Show, Hide: Change the visibility for UI Elements and Containers.
- Enable, Disable: Change the accessibility for UI Elements and Containers.
- Required, Not Required: Change the allowBlank and toggle the red star (*) label flag on/off.
- These actions are applicable for Containers and Sections: they change the state of all children's fields.
- Not applicable for the children's Business Objects Searches.
- Clear: Set the field value to NULL.
- For Radiogroups without None option it will uncheck the active radio and set an undefined value.
- If this action is applicable for Containers and Sections, it clears all the children fields.
- Not applicable for children BO Searches.
- Clear action doesn't set the default value of fields.
- Hide & Clear: Just a combination of Hide and Clear.
Attention! Clear action doesn't work correctly with Default Values of Reference Objects if it is triggered on form load.
Case Sensitivity Handling
The Comparison is case sensitive for form rule conditions Equal, Not Equal, Contains, Not Contains in the Many-2-Many relationships, and insensitive for conditions Contains and Not Contains for One-2-Many relationships.
Examples of case sensitivity results:
A vs A = true
A,B vs B,A = true
A vs A = false
A,B vs B,A = false
ABC vs ab = true
|A,B vs A = true|
A,B vs a = false
ABC vs ab = false
|A,B vs A = false|
A,B vs a = true
Custom Form Rules
You can read about how to add a Custom Rule in the following article How To Add a Custom Rule in MDM Forms