Validation Rules block a save when their formula evaluates to TRUE — they're the platform's first line of defense against bad data. Setup lives under Object Manager, one rule at a time, scoped to a single object.
- Open Setup → Object Manager
Top-right gear icon → Setup → Object Manager. Pick the object you want to validate (Account, Contact, custom — anything).
- Open the Validation Rules section
From the object's left rail, click Validation Rules.
- Click New
Top-right. Each rule is an independent record.
- Name and describe the rule
Rule Name is API-safe (no spaces). Description is for fellow admins — explain *why*, not just *what*, because the formula will tell anyone what.
- Build the Error Condition Formula
The formula must return TRUE when the data is *bad*. The Insert Field and Insert Operator buttons help you build it without typos.
- Set the Error Message and Location
The message shown to the user when the rule blocks save. Location is either "Top of Page" or a specific field — field-level errors are more helpful.
- Activate
Tick the Active checkbox at the top before saving the rule. Inactive rules don't fire.
The Boolean formula. Returns TRUE → block save. The single most-confused part of validation rules — TRUE means "reject", not "accept".
"Top of Page" puts the message above the page-level error banner; "Field" attaches it inline next to the offending field. Field-level is friendlier when the rule is field-specific.
On = enforced; Off = saved but ignored. Useful for staging fixes before flipping the switch in production.
- Validation rules fire on UI saves *and* on every API/Apex/Flow DML — a rule designed for the screen can break a nightly integration. Test against your bulk loads.
- TRUE = reject is the inverse of what most people guess. Sanity-check by reading the formula as "reject when ___" out loud.
- Validation rules run *after* before-save Flows and triggers but *before* after-save logic — a Flow that fixes the data still has to satisfy the rule on the saved record.