Adding validation rules
Most Altogic fields already have default validation rules, such as min/max length of text or min/max, positive/negative values assigned to a number, etc. However, when special rules are needed while creating or updating objects in the database, you can create custom validation rules.
To specify the custom validation rules of a field already created via the Designer, you need to Navigate to Models view and select the model and then the field that you would like to add the validation rule(s).
Validation rules can be specified only for the following field types: text, object id, rich-text, email, link, boolean, integer, decimal, date-time, options list, geo point, object reference, basic values list, and file reference.
To add a validation rule to a field via the Designer:
- Select Validation rules
- In the validation rules view, select New rule
- In the rule name, provide a descriptive name to your validation rule, specify the rule expression, and the error message expression returned when the rule is evaluated to false. Specify whether you would like to run the remaining validation rules (if any) if this one fails.
- Select Create