---
schema_version: "1"
id: 3ca50b50ee7060099d82f1f0d43a5c2107df290f9d04bd661a3c5bc7545cff78
title: Validation Rules
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/fields_about_field_validation.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.fields_about_field_validation.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 0cd5923a65cfbedb73dbdcaa0e7ff43b852c0fe93734b77f90478ce91616c3bc
description: Improve the quality of your data using validation rules. Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Validation Rules

Improve the quality of your data using validation rules. Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Essentials</strong>, <strong>Contact Manager</strong>, <strong>Group</strong>, <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, <strong>Developer</strong>, and <strong>Database.com</strong> Editions</td></tr></tbody></table>

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.

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_important.png)

Important We don’t recommend using a custom number field that Einstein Prediction Builder manages in a validation rule. If the prediction changes the field value in a way that violates the validation rule, you can’t update the record that uses the field. If you get a validation rule error when saving a record that contains an Einstein Prediction Builder field, edit, deactivate, or delete the validation rule.

After you have defined validation rules:

1. The user chooses to create a record or edit an existing record.
2. The user clicks **Save**.
3. All validation rules are verified.
    - If all data is valid, the record is saved.
    - If any data is invalid, the associated error message displays without saving the record.
4. The user makes the necessary changes and clicks **Save** again.

You can specify the error message to display when a record fails validation and where to display it. For example, your error message can be “The close date must occur after today's date.” You can choose to display it near a field or at the top of the page. Like all other error messages, validation rule errors display in red text and begin with the word “Error”.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_note.png)

Note In Salesforce Classic, users with custom profiles must have Read permission on a standard object to view validation rules for that object.

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_important.png)

Important Validation rules apply to new and updated records for an object, even if the fields referenced in the validation rule aren’t included in a page layout or an API call. Validation rules don't apply if you create records for an object with Quick Create. If your organization has multiple page layouts for the object on which you create a validation rule, verify that the validation rule works on each layout. If your organization has any integrations that use this object, verify that the validation rule works for each integration.

- **[Managing Validation Rules](https://help.salesforce.com/s/articleView?id=platform.fields_managing_field_validation.htm&release=264.0.0&type=5)**  
    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.
- **[Define Validation Rules](https://help.salesforce.com/s/articleView?id=platform.fields_defining_field_validation_rules.htm&release=264.0.0&type=5)**  
    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.
- **[Clone Validation Rules](https://help.salesforce.com/s/articleView?id=platform.fields_cloning_field_validation_rules.htm&release=264.0.0&type=5)**  
    Create new validation rules quickly by using existing rules as your starting point.
- **[Activate Validation Rules](https://help.salesforce.com/s/articleView?id=platform.fields_activating_field_validation_rules.htm&release=264.0.0&type=5)**  
    How to activate and deactivate validation rules.
- **[Validation Rules Fields](https://help.salesforce.com/s/articleView?id=platform.fields_validation_rules_fields.htm&release=264.0.0&type=5)**  
    A list of fields and description for validation rules.
- **[Tips for Writing Validation Rules](https://help.salesforce.com/s/articleView?id=platform.fields_validation_rules_tips.htm&release=264.0.0&type=5)**  
    Keep these tips in mind when writing validation rules.
- **[Validation Rule Considerations](https://help.salesforce.com/s/articleView?id=platform.fields_validation_considerations.htm&release=264.0.0&type=5)**  
    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.

#### See Also

- [Examples of Validation Rules](https://help.salesforce.com/s/articleView?id=platform.fields_useful_field_validation_formulas.htm&release=264.0.0&type=5 "Review examples of validation rules for various types of apps that you can use and modify for your own purposes. Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record.")
- [Custom Metadata Type Fields and Validation Rules](https://help.salesforce.com/s/articleView?id=platform.custommetadatatypes_field_validation.htm&type=5&language=en_US)
- [Custom Metadata Types and Validation Rule Formulas](https://help.salesforce.com/s/articleView?id=platform.custommetadatatypes_validation_rules.htm&type=5&language=en_US)
- [Considerations for AI Prediction Fields](https://help.salesforce.com/s/articleView?id=platform.custom_field_set_prediction_ai.htm&release=264.0.0&type=5 "When you use Einstein Prediction Builder to build a prediction, a custom field is created for storing and displaying the prediction scores on records. Or, you can create a predictive custom field manually, and enter its name and label when building a prediction in Einstein Prediction Builder.")
- [Einstein Prediction Builder Editions and Permissions](https://help.salesforce.com/s/articleView?id=sales.custom_ai_prediction_builder.htm&type=5&language=en_US)
- [Edit Object Permissions in Profiles](https://help.salesforce.com/s/articleView?id=platform.perm_sets_object_perms_edit.htm&type=5&language=en_US)