Validation rules
Validation rules are logic checks in a CRM that stop a record from saving when field values break a defined condition, and show the user an error explaining what to fix.
Also called: Salesforce validation rules, CRM validation, field validation, data validation rules
Validation rules are logic checks in your CRM that stop a record from saving when its values break a condition you define, then tell the user what to fix. Where required fields only catch blanks, validation rules catch nonsense: a close date in the past, a negative amount, a 60% discount nobody approved.
How it works
Each rule has two parts: a condition that evaluates to true or false, and an error message. When the condition is true, the save fails and the message appears on the field or at the top of the record. In Salesforce, rules are written as formulas. In HubSpot and most modern CRMs, you get property-level rules (format, range, allowed characters) plus stage requirements, with more complex logic handled by workflows.
A typical rule reads like this in plain logic:
IF stage is not Closed AND close date < today THEN block save: "Close date is in the past. Update it or close the deal."
Common rule types:
- Format checks: phone numbers with the right digit count, website fields that look like domains, postal codes per country. These support data normalization.
- Range checks: amount greater than zero, discount at or below a ceiling, probability between 0 and 100.
- Cross-field logic: if stage is Closed Lost, loss reason can't be blank; if the deal is multi-year, contract length must be 24 months or more.
- Change control: stop reps from moving a deal backward from Closed Won, or from editing amount after a contract is signed without an approval flag.
Example
Say a team keeps seeing deals with stale close dates. Pulling the open pipeline shows 420 open opportunities, 90 of them with a close date already behind them (an example count). That's 21% of the pipeline sitting in the forecast for a month that's over.
The team adds one rule: an open deal can't save with a close date before today. Reps now have to touch those 90 deals the next time they edit them. A one-time report forces the cleanup, and the rule keeps it clean afterward.
Second rule, on money. Say average deal size is $30,000 and reps occasionally discount 35% to close at quarter end. A rule that blocks discounts above 20% unless a deal desk approval box is checked means every big discount gets a second set of eyes. If that stops just two unnecessary 15 point discounts a quarter, that's 2 x $30,000 x 0.15 = $9,000 of revenue kept.
How to set it up
- Start from a broken report, not a theory. Find the field that keeps making a dashboard wrong.
- Write the error message for a rep, not an admin. "Close date is in the past. Move it out or mark the deal lost" beats "Validation error 14."
- Test in a sandbox with your integrations running. A rule that blocks your enrichment sync will fail silently and leave records half updated.
- Add a bypass for system users or a migration flag, so bulk loads and CRM migrations don't stall.
- Document every rule: what it checks, why, who owns it, the date it went live.
- Pair rules with duplicate rules and data governance ownership so quality has a person behind it.
Common mistakes
- Writing rules so strict that reps fill fields with placeholder values just to save the record.
- Launching rules with no warning, so the first time reps hear about them is when a save fails mid-call.
- Not testing rules against API writes, which breaks enrichment, routing or billing syncs.
- Using vague error messages that don't say which field to fix or how.
- Piling up rules for edge cases nobody remembers, until a simple update triggers four errors.
FAQ
What is an example of a validation rule?
A classic one blocks an open opportunity from saving if its close date is in the past. Another requires a loss reason when the stage is Closed Lost, or blocks a discount above 20% unless an approval checkbox is ticked. Each rule pairs a condition with an error message that tells the user exactly what to change.
Do validation rules apply to integrations and imports?
In most CRMs, including Salesforce, validation rules fire on every save, whether it comes from a user, an import or an API call. That's good for data quality but can break integrations that write partial records. Test new rules against your sync tools and add bypass logic for trusted system users where it makes sense.
How many validation rules is too many?
There's no fixed number, but every rule should map to a report or process that breaks without it. If nobody can explain why a rule exists, or reps hit it daily and enter junk to get past it, it's doing more harm than good. Audit rules once or twice a year and retire the ones nobody needs.
Related
Used in these articles
- ArticleHubSpot vs Salesforce: An Honest Comparison for Teams Under 200
- ArticleSalesforce to HubSpot Migration: Map the Objects, Then Pick the Cutover
- ArticleHubSpot Data Quality Tools: What They Fix and What They Miss
- ArticleStructured Outputs: Make AI Return Data Your CRM Can Use
- ArticleCRM Data Hygiene: The Audit and the Monthly Cleanup Job
- ArticleData Normalization in Your CRM: Job Titles, Countries, Phones and Company Names