Customizing Validation Rules

You can customize the validation rules for a given data field by creating or editing the rule section of the EntityAttribute element for the desired field in the custom business metadata, which can be accessed from the Entity Overview component.

Because the system always applies the base customization rules first, the custom validation rules can only place additional restrictions on the data. Custom validation rules that are less restrictive than the base rules will have no effect.

For example, to add a constraint to the ESST6 field (on the Category entity), to require a user to select a value from the STAFF code table, you would follow these steps:

  1. On the Entity Overview component, use the Quick Find search box to locate the Proposal entity row.

  2. Click the Entity ID link in the proposal entity row.

    The system takes you to the Business Metadata Summary component for the Proposal entity.

  3. Click the Base Metadata tab.

  4. Locate and copy the following excerpt:
             <EntityAttribute id="ESSST6" type="char" key="false" label="ESSST6">
              <ValidationRules>
                <Rule type="MaxLength">
                  <Arguments>
                    <Argument name="MaxAllowed">256</Argument>
                  </Arguments>
                </Rule>
              </ValidationRules>
            </EntityAttribute>

  5. Click the Custom Metadata tab and paste the excerpt in the appropriate place.

  6. Add a new rule section so the excerpt now looks like this:
             <EntityAttribute id="ESSST6" type="char" key="false" label="ESSST6">
              <ValidationRules>
                <Rule type="MaxLength">
                  <Arguments>
                    <Argument name="MaxAllowed">256</Argument>
                  </Arguments>
                </Rule>
                 <Rule type="CodeTable">
                  <Arguments>
                    <Argument name="TableName">STAFF</Argument>
                  </Arguments>
                </Rule>
             </ValidationRules>
            </EntityAttribute>

  7. Click the Save button.

Related topics:

Data Validation

Adding Agency Fields

Customizing Field Labels and Locations

 

Blue bar indicating the end of the topic