In short: Go to Setup → Validation Rules, click + New Rule and pick the object. Type a Name and an Error Message, then set up to 3 conditions under Block the save when ALL of these match. Click Create Rule. From then on, any save where every condition matches is refused and the person sees your message.
Before you start
- Only the workspace owner and people with the System Administrator profile can create, change or delete validation rules.
- Open Setup from your avatar in the top right, then ⚙ Setup. Validation Rules are under Data Management.
- Rules are built from conditions you pick from lists, not typed formulas. Think of each rule as "block the save when this is true".
- For when to use a rule and when to use a Flow, read Flows, workflow rules or validation rules: which to use.
Create a rule
- Go to Setup → Validation Rules and click + New Rule.
- Choose the Object. You can use Leads, Accounts, Contacts, Opportunities, Tasks, Events, Products, Quotes, Campaigns and any custom object that has a field a rule can test.
- Type a Name, for example "Close Date can't be in the past".
- Type the Error Message. Write it as an instruction, for example "Move the Close Date to today or later, or close the deal."
- Leave Active ticked.
- Under Block the save when ALL of these match (up to 3), pick a field, an operator and, where needed, a value. Rows left on — None — are ignored.
- Click Create Rule.
Operators by field type
| Field type | Operators you can use |
|---|---|
| Text, email, phone, URL | equals, does not equal, contains, is empty |
| Picklist | equals, does not equal, is empty |
| Multi-select picklist | includes, excludes, is empty |
| Checkbox | equals, does not equal (True or False) |
| Number, currency, percent | equals, does not equal, is greater than, is less than, is at least, is at most, is empty |
| Date and date/time | is in the past, is in the future, is empty |
| Lookup | is empty, is not empty |
You can also test fields you've added to an object yourself, listed under Custom fields, and every record's Created Date and Last Modified Date. On Contacts and Opportunities you can test the related Account's fields, and on Quotes the related Opportunity's fields, such as the Account's Industry.
Examples
| Rule | Object | Conditions | Error Message |
|---|---|---|---|
| No open deals in the past | Opportunity | Close Date is in the past, AND Stage does not equal Closed Won, AND Stage does not equal Closed Lost | Move the Close Date to today or later, or close the deal. |
| Won deals need an amount | Opportunity | Stage equals Closed Won, AND Amount is empty | Enter the Amount before marking this deal Closed Won. |
| A way to reach every lead | Lead | Email is empty, AND Phone is empty | Add an email address or a phone number. |
Use the stage names your workspace actually has. A Close Date of today counts as in the past, because the check compares the date with the current moment.
Where the message shows
When a save matches every condition, the record isn't saved and the person sees your Error Message:
- On the record form or an inline edit, the message shows so they can fix the record and save again.
- In an import, that row fails with your message as the reason. The other rows still go in.
- Through the API, Zapier or the Claude or ChatGPT connector, the request is refused with your message.
- On a web-to-lead form, no Lead is created and the visitor sees an error page.
If more than one rule matches, only one message shows. Fix it and save again to see if another rule applies.
When rules run
Rules run every time a record is created or changed, on every object they apply to, before assignment rules and duplicate checks. They check the record as it would be saved, after any Flow set to run before the save has changed it. Rules also run when a Lead is converted. Rules on an object your workspace has turned off don't run while it is off.
Switch a rule off or delete it
- Go to Setup → Validation Rules.
- Click the rule's name.
- Untick Active and click Save.
The rule stays in the list as Inactive, ready to switch back on. To remove it for good, click Delete next to it in the list.
Want to try a rule without affecting your team? Build it in a sandbox first. For more ideas, read keep CRM data clean with validation rules.
Frequently asked questions
Can I write a formula like in Salesforce?
No. Each rule is up to 3 conditions that must all be true. For a check that needs "or", make two rules, or use a Flow with a Custom Error element. See Build a Flow.
Why does a blank number not trigger my rule?
A blank number never matches a comparison such as is less than. Add a separate rule that uses is empty to catch blanks.
Do rules check records that already exist?
Not until someone saves them. An existing record that breaks a rule can't be saved again until it's fixed.
How do I make a field required only for new records?
Add the condition Created Date is empty. A record being created has no Created Date yet, so the rule only applies on create.
Can I change the rule's object?
No. The object is fixed once the rule is created. Make a new rule for a different object.
