Salesforce / How-to
Documenting a validation rule so the next person understands it
The formula says what a validation rule blocks. It doesn't say why. Here's how to turn it into a description someone can act on without opening the builder.
A validation rule blocks a save with an error message and a formula, and neither one tells you why the rule exists. Six months later someone hits it, doesn’t understand it, and either files a ticket or works around it by changing an unrelated field until the error goes away. Both cost more time than writing the rule down once would have.
What you’re actually documenting
Three separate things, and a good description keeps them separate:
- What the formula checks. The literal condition, translated out of Salesforce syntax.
- Why it exists. The business rule or edge case someone was protecting against. This is usually not written anywhere and has to be reconstructed.
- What to do when it fires. The fix from the user’s side, not the admin’s.
Most validation rule documentation, when it exists at all, only covers the first one.
Step 1: give it the formula and the error message, together
Object: [e.g. Opportunity]
Validation rule formula:
[paste the exact formula]
Error message shown to the user:
[paste it exactly as it appears]
Error location: [record-level banner, or a specific field]
Translate this formula into plain English. State the exact condition that
blocks the save, in one or two sentences a non-technical user could read.
Don't guess at intent yet, just the logic.
Ask for the translation on its own first. A formula with nested AND/OR or a ISPICKVAL check against several values is exactly where a fast read gets the logic backwards, and it’s cheaper to catch that now than after the intent has been layered on top of a wrong reading.
Step 2: verify the translation against a real record
Before trusting the plain-English version, test it. Either pull up a record you know should pass and one you know should fail, or build two fake ones with the shape from your sample-data guide if the real records aren’t something you can paste in.
If the plain-English description doesn’t correctly predict which record fails, the formula reading was wrong. Go back to step 1 with the specific mismatch named, rather than asking for a general re-check.
Step 3: reconstruct the why
This is the part a formula can’t answer on its own, so treat the AI’s answer as a hypothesis, not a fact.
Given this validation rule and what it checks: [paste your verified
translation]
What business problem would a rule like this typically prevent?
Give me two or three plausible reasons, not one confident guess.
Pick the reason that matches what you actually know about the process, or go ask whoever built it. Writing down a plausible-sounding but wrong reason is worse than leaving the field blank, because the next person will trust it.
Step 4: write the description for the person who hits the error
Write a two-to-three sentence description combining:
1. What triggers this error, in plain language
2. Why the rule exists: [paste the reason you settled on]
3. What the user should do differently to pass
Audience: someone who has never seen this rule before and just
hit the error message.
Put this somewhere it’ll actually be found: a description field on the rule itself, a shared doc linked from there, or wherever your team keeps this kind of note. A perfect description nobody can find helps nobody.
When it breaks
The formula translation and the actual behavior disagree on an edge case. Formulas with date logic, blank-field checks, or record type conditions are the most common place this happens. Test more records at the boundary, not just one obvious pass and one obvious fail.
Nobody can confirm which reason from step 3 is correct. Say so in the description rather than picking one to sound complete: “Reason unconfirmed, likely protects against [X]” is more useful six months from now than a fabricated certainty.
The rule turns out to have no clear reason anymore. Some validation rules outlive the process they were built for. That’s worth flagging to whoever owns the object, not documenting as if it’s still load-bearing.
The formula is too complex to translate in one pass. Break it at each top-level AND/OR and translate the pieces separately before combining them. A formula you can’t summarize in two sentences once broken apart is a sign the rule itself may be doing too much.
What to try next
The same four steps work for a required-field rule, a duplicate rule, or a process built into automation instead of a formula. The specifics change; translating logic, verifying it, reconstructing intent, writing for the person who hits it, doesn’t.
Next
- Document a validation rule The paste-ready version, no walkthrough
- The spec interrogation prompt The same discipline, used before something gets built instead of after
- Writing a Flow description AI can actually follow The same method, for automation instead of a single formula
- Subscribe by RSS New guides as they publish
Not quite right? Tell it what to change
The first answer is a draft. You don't need perfect wording to fix it. Say what's wrong in plain language, like one of these.
- The answer is too long
Make that shorter and keep only what I need to know.
- It sounds too formal
Make this sound more natural and conversational.
- It misunderstood me
That's not quite what I meant. I need help with [what you meant].
- It added things I never said
Use only the facts I gave you. Don't assume or add missing information.
- I don't understand its answer
Explain that in simpler language and give me an example.
- You can't find a button or setting this guide mentions
-
AI apps change their screens often. This guide was last updated September 14, 2026. If something no longer matches, say so in the feedback below.
Did this help you get it done?
What got in the way?
Anonymous. This sends your answer and the address of this page, nothing else.
Get new guides by email
New guides when there are new guides. No schedule, no newsletter, nothing else sent to you. Everything here stays free and open whether you sign up or not.
Stuck on this page?
Ask about anything on this page and you'll get an answer drawn from this guide only. No account needed. It can still be wrong. Check anything that matters.