Field validation

Field validators handle simple validation for a single field. A validator definition defines a regular expression, which a data field must match to be valid. It can also define an optional input mask that provides a visual indication to the user of the data to enter in the field.

Each field in PolicyCenter has a default validation based on its data type. For example, integer fields can contain only numbers. However, it is possible to use a field validator definition to override this default validation.

  • You can apply field validators to simple data types, but not to typelists.
  • You can modify field validators for existing fields, or create new validators for new fields.

For complex validation between fields, use validation-specific Gosu code instead of simple field validators.

Specifying the properties of a specific field

Field validators specify only the validation properties for a general kind of input (for example, any postal code). They do not specify the properties of a specific field in a particular data view. Instead, detail views and editable list views include additional validation attributes in their configuration files.

Specifying field validators on a delegate entity

Apply any field validators for elements existing on a delegate entity to the delegate entity. Do not apply any field validators to the entities that inherit the elements from the delegate. Applying a field validator to an element on the delegate entity ensures that PolicyCenter applies the field validator uniformly to that data element in whatever code utilizes the delegate.