Validation rules

I bet you already know what a validation rule is, but let's discuss them again. A validation rule is a feature that is used to improve data quality. It is checked before a record is saved in the database.

They are defined by the following:

  • A name
  • An Active flag
  • A condition (formula) that should trigger the error (a chain of conditions on fields of the object or related objects that triggers an error if evaluated as true)
  • An error message that is displayed to the user
  • A place where the error can be displayed

Here is an example of a validation rule:

Example of a simple validation rule

This validation rule prevents a user from ...

Get Salesforce Advanced Administrator Certification Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.