Skip to main content

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).

Field detail view

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:

  1. Select Validation rules
  2. In the validation rules view, select New rule
  3. 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.
  4. Select Create