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.
Note: New validation rules are not applied to existing data, but only to new or modified data entered after the validation rule is created.
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:
On the Entity Overview component, use the Quick Find search box to locate the Proposal entity row.
Click the Entity ID link in the proposal entity row.
The system takes you to the Business Metadata Summary component for the Proposal entity.
Click the Base Metadata tab.
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>
Click the Custom Metadata tab and paste the excerpt in the appropriate place.
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>
Click the Save button.
Note: An additional change required when constraining a field to a code table is to change the elementType for the field in the presentation metadata (via the Page Options window) to be dropdown wherever the ReadOnly value for the field is false.
Customizing Field Labels and Locations