Validation rules and options

Current version: 10.2

Data is validated throughout the system and covers the entire data definition area within the system to control the validity and authenticity of the data definition structure.

Validation rules and options validate field values using field validation rules resolved on-the-fly and based on settings specified in the web.config file. These validation rules validate a single field value in a single language version of an item. They can also validate each item using any number of item validation rules, which validate global values such as the item name, as well as conditions involving multiple field values.

When validating items and fields, the validation rules use the same basic technology. The main differences between item and field validation rules are:

  • Field validation rules validate values in one or more fields in a single language version. Whereas item validation rules validate item data shared to all versions, such as the item name, as well as conditions involving multiple field values.

  • The user interface displays its field validation rules from /sitecore/System/Settings/Validation Rules/Field Rules, and its item validation rules from /sitecore/System/Settings/Validation Rules/Item Rules.

  • In templates, the template field definitions define the field validation rules, whereas the template standard values and individual items define the item validation rules.

Any field validation issues appear to the left of the field value in the Content Editor as colored bars. The colors displayed are:

  • Gray for no errors.

  • Yellow for warnings.

  • Red for errors.

In the following image, you can see a field validation warning (the red bar) with a tooltip explanation displayed that contains more details about the error.

Example of field validation rule flag in the user interface.

Do you have some feedback for us?

If you have suggestions for improving this article,