Validation rules in salesforce contains a formula or expressions that evaluates the data in one or more fields in a record to meet the standards and returns a value “True” or “False”. Validation rules displays error message to the user when the Condition is “False”.
There are five types of Rules in salesforce and the priority of each rule is according to their order. Salesforce processes rules in the following order.
- Validation Rules.
- Assignment Rules.
- Auto-response Rules.
- Workflow Rules.
- Escalation Rules.
Validation Rules in salesforce are to enforce integrity constraints(conditions) against the data. Here we give conditions in formula editor to meet our requirement. If one validation rule fails, salesforce continues to check another validation rule contained in the field or record and displays appropriate error message at that field or above the Record.
Important points to remember on Validation rules.
- If validation rules exist for activities and we created an activity during the lead conversion. Here the lead converts but the task is not created in the activity.
- Campaign hierarchies ignore validation rules.
- Validation rules are made to run before creating records submitted through web-to-lead and web-to-Case.
Validation rule fields restrictions.
Validation rule formulas don’t refer to the following fields in salesforce.
- Compound fields.
- First and Last names.
- Dependent picklist and lookups.
- Campaign static fields.
- Merge fields for auto numbers.
- Compound address fields(Mailing address).