Quick summary
A Salesforce validation rule lets admins enforce data quality by blocking record saves when field values fail a defined error condition formula. This step-by-step walkthrough covers everything from opening Object Manager to writing the formula and saving the rule.
Steps
- Go to Setup in the top-right corner of Salesforce.
- Search for Object Manager using the Quick Find box.
- Select the object you want to enforce the rule on, such as Leads or Opportunities.
- Find the Validation Rules section and click on it.
- Click New to begin creating a new validation rule.
- Start defining the rule by filling in the Label and Error Condition Formula fields.
- Enter a clear Label for your rule, such as "Opportunity Requires Amount".
- Select Active to make the validation rule enforceable immediately.
- Write an Error Message that clearly tells users what went wrong when validation fails.
- Build your Error Condition Formula using the formula builder to define the criteria that triggers the error, for example checking that Amount is filled for Closed Won opportunities.
- Click Save to create and activate the validation rule.
