Validation Rule Considerations
Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record. A validation rule can contain a formula or expression that evaluates the data in one or more fields and returns a value of “True” or “False”. Validation rules also include an error message to display to the user when the rule returns a value of “True” due to an invalid value. Review these considerations before implementing validation rules in your organization.
Required Editions
| Available in: both Salesforce Classic and Lightning Experience |
| Available in: Essentials, Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions |
How Salesforce Processes Validation Rules
Salesforce processes rules in the following order:
- Validation rules
- Assignment rules
- Auto-response rules
- Workflow rules (with immediate actions)
- Escalation rules
In addition,
- When one validation rule fails, Salesforce continues to check other validation rules on that field or other fields on the page and displays all error messages at once.
- If validation rules exist for activities and you create an activity during lead conversion, the lead converts but a task isn’t created.
- Validation rules are only enforced during lead conversion if validation and triggers for lead conversion are enabled in your organization.
- Campaign hierarchies ignore validation rules.
- Salesforce runs validation rules before it creates records submitted via Web-to-Lead and Web-to-Case and then creates records that have valid values.
- To give a default value to a division field before the validation rule evaluation, the division field must be on the page layout.
- Validation rules continue to run on individual records if the owner is changed. If the Mass Transfer tool is used to change the ownership of multiple records, however, validation rules don’t run on those records.
Validation Rule Field Restrictions
Validation rule formulas don’t or can’t refer to:
- Compound fields, including addresses, first and last names, and dependent picklists and
lookups
Note However, you can use compound fields inISNULL,ISBLANK, andISCHANGEDfunctions. - Campaign statistic fields, including statistics for individual campaigns and campaign hierarchies
- Merge fields for auto-number or compound address fields, such as Mailing
Address
Note You can use merge fields for individual address fields, such as Billing City, in validation rule formulas.
In relation to other fields and functions in Salesforce, validation rules behave as follows:
- The detail page of a custom activity field doesn't list associated validation rules.
- Workflow rules and some processes can invalidate previously valid fields. Invalidation occurs because updates to records based on workflow rules and also on process scheduled actions don’t trigger validation rules.
- Process record updates on immediate actions do fire validation rules.
- You can’t create validation rules for relationship group members.
- You can use roll-up summary fields in validation rules because the fields don’t display on edit pages. Don’t use roll-up summary fields as the error location.
- Validation rules for the Content Version object aren't triggered when files are uploaded from Chatter.
- When uploaded from the Files Tab, validation rules are triggered for Lightning but not for Classic.
Lookup Filters vs. Validation Rules
Validation rules and lookup filters achieve similar ends, but offer different advantages. Use a lookup filter:
- To improve user efficiency by limiting the number of available options in a lookup search dialog.
- To improve user efficiency by automating filters on lookup search dialogs that your users manually set.
Use a validation rule:
- If you're close to the maximum number of lookup filters allowed.
- To implement a complex business rule that requires you to use a formula. Formulas can
reference fields that basic filter criteria can't reference, such as fields on the parent
of the source object. Formulas can also use functions. For example, use
ISNEWto apply the rule only on record creation, orISCHANGEDto apply the rule only when a field changes.

