User Defined Rules

A User Defined Rule is used to configure custom rules on a field or set of fields that are not a part of the predefined rules in MDO. User Defined Rules give administrators the capability to write their own validation code in JavaScript or generate a code by logic through the UI. 

For example, when a Project Start Date field should have a date before the Project End Date field, User Defined Rule can establish the check. 

To configure a User Defined Rule within a module: 

  1. Click on the Settings icon at top right corner on the Home page. 
  2. From the left menu bar, select Modules. 
  3. Select the module > Business Rules  
  4. Select the User Defined Rule tab > Add New Rule. 
  5. Select either Active Governance or Passive Governance according to the rule. 
  6. Select the field for which the rule needs to be set (for Active Governance) or write the description of the rule (for Passive Governance) and select Save.

In case of Active Governance,  

  • Select Create on the right-hand side of the page. 
  • Select the JavaScript Event (Event refers to the state or change of state of the object.) For example, selectonblur, onchange, onclick, etc. This JavaScript event will determine which action will trigger the rule. 
  • Choose either JavaScript or Template  
  • For Enterprise customers enter the Plant Code (Note: This will only appear for private enterprise customersas for shared cloud customers the system will automatically select the Plant Code.)
  • Select Finish. 
  • To modify/create the code, select Code on the right-hand side of the page 
  • Write the code and select Compile. If the code is compiled, select Save. 
  • To activate the rule, check Active. 

In case of Passive Governance, 

  • Select the Field, Operator and the Comparison metric (Valuefor each block. 
  • Add another block by selecting +’ on the left-hand side of the block under Action and select the FieldOperator and Comparison metric for this block. 
  • Repeat Step for all the required blocks. 
  • When the condition blocks are complete, select Generate. 

The code will be generated, and the rule added.