Skip to content

Validation and Verification in Salesforce

  • Salesforce
  • Data quality
Cover illustration for the Mastering Salesforce Data guide

What do Salesforce Validation Rules check?

Controlling duplicates is one way to protect data quality. Validation Rules are Salesforce's other native, no-cost tool for the job: a rule checks that data entered by a user meets a specific standard before the record can save — a required name field, for instance. Admins write these as yes/no statements; if the criteria aren't met, an error message stops the save until the record is fixed.

It's a simple mechanism, and it covers a lot of an organization's basic needs on its own.

How a validation rule is built

  • Rule criteria — a logical, formula-like expression that decides whether the data is valid. For example: if the name field is empty, block the save.
  • Error message — a customizable message shown when the criteria fail, telling the user what to fix.

Common applications:

  • Requiring fields to be filled out.
  • Validating formats — phone numbers, email addresses.
  • Enforcing business logic, like requiring a close date to be in the future.

Where it's used in practice:

  • Spotting recurring data-entry mistakes and writing a rule to block them.
  • Translating a business process into an enforceable rule.

How to test a validation rule properly

A rule that's too strict blocks legitimate work; one that's too loose lets the bad data back in. Before rolling one out:

  1. Understand the requirement driving the rule, and what should happen when it triggers.
  2. Write test scenarios covering both the cases that should pass and the ones that should fail.
  3. Use realistic sample data that covers the different conditions the rule checks.
  4. Test both directions — data that should be blocked, and data that shouldn't.
  5. Test across user profiles, since permissions can change how a rule behaves.
  6. Test across record types if your org uses more than one.
  7. Check the error message is clear enough to tell a user how to fix the problem.
  8. Test on bulk data, not just single records — a rule that's fine one record at a time can still slow down a bulk load.
  9. Run regression tests whenever the rule or the org's configuration changes.
  10. Use the Developer Console to simulate the rule against test records before it goes live.
  11. Document the test cases so the next person doesn't have to reconstruct them.
  12. Check the audit trail after testing to confirm which rules actually fired.
  13. Balance strictness against flexibility — too many rules, or rules that are too strict, slow down the people who have to use the org every day.

Where do validation rules fall short?

Data validation ranges from a simple format check on an email address to a rule spanning several conditions and dependent fields, like geocodes. Salesforce's native validation covers a good share of that range, but not all of it.

  • No cross-record verification. A validation rule checks one record at a time; it can't compare data across multiple objects. That needs an Apex trigger instead.
  • Skipped during some processes. Lead conversion is the clearest example — validation may not apply uniformly, and some steps of the conversion can skip it.
  • Silent in certain scenarios. Campaign hierarchy changes and mass ownership transfers are two places where rules simply don't trigger.
  • Bypassed during mass record changes. Tools like Mass Transfer change ownership on many records at once, and validation rules typically only fire when records are edited individually.

Used well, validation rules are genuinely useful for enforcing business logic and catching common entry mistakes — the testing steps above are how you keep them that way. But they have real edges: no cross-record checks, gaps during lead conversion, and blind spots during mass changes. Where those edges matter, Apex triggers or a dedicated tool pick up what the native rules can't reach.

The next chapter turns to the wider set of challenges Salesforce administrators run into while trying to keep their data reliable.

Hungry for more?

  • Cover illustration for the Mastering Salesforce Data guide

    Guides

    Challenges of Salesforce Data Management

    Seven recurring problems in Salesforce data management, from duplicate records to thin reporting, and why the AppExchange is where most teams go next.

Frequently asked questions

What is the purpose of Salesforce Validation Rules?

Validation Rules check that data entered by a user meets specific criteria before a record can be saved, blocking incomplete or incorrectly formatted entries and helping maintain data integrity and accuracy.

How do Salesforce Validation Rules work?

A rule uses a formula-like expression to define whether data is valid. If a record fails that check when a user tries to save it, an error message appears, telling the user what to correct before the save can go through.

What's the difference between validation and verification in Salesforce?

Validation checks that data is in the right shape — a required field is filled in, a format is correct. Verification checks whether the data is actually true, such as confirming an email address exists rather than just looking correctly formatted.

Can Salesforce Validation Rules check data across multiple records?

No. Validation Rules only evaluate one record at a time and can't perform cross-record or cross-object checks. That kind of logic needs an Apex trigger instead.

When do Salesforce Validation Rules not apply?

They can be skipped during specific processes like lead conversion, and they typically don't trigger during mass record changes such as bulk ownership transfers, since those usually bypass the checks that apply to individual record edits.

Ready to take control?

With a product tour you can walk through the product yourself without installing anything, or book a demo for a guided look.