10 Must-Know Salesforce Validation Rules for Every Admin
In Salesforce, data quality is everything. Whether you’re managing leads, opportunities, or cases, clean and accurate data ensures smoother processes, better reporting, and higher adoption among users. One of the most powerful tools at an admin’s disposal for maintaining data integrity is the Validation Rule.
Validation rules prevent users from saving incorrect or incomplete data by setting conditions that must be met before a record is saved. If those conditions aren’t met, Salesforce displays an error message and stops the save.
In this blog, we’ll explore 10 essential validation rules every Salesforce Admin should know — complete with explanations and examples.
1. Ensure Required Field Completion Beyond Page Layouts
Page layouts can make a field “required,” but what if that requirement depends on certain conditions? That’s where validation rules shine.
Example: Make “Phone” required only when Lead Source = “Phone Inquiry”.
AND(
ISPICKVAL(LeadSource, “Phone Inquiry”),
ISBLANK(Phone)
)
2. Enforce Email Format with REGEX
Users often enter invalid email formats. Use REGEX to ensure emails are valid.
Example: Validate email format on Contact.
NOT(REGEX(Email, “^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$”))
3. Close Date Cannot Be in the Past
Opportunities shouldn’t have a close date earlier than today.
CloseDate < TODAY()
4. Opportunity Amount Must Be Positive
Prevent users from entering zero or negative amounts.
Amount <= 0
5. Prevent Changing Stage Backwards
Keep your sales pipeline clean by stopping reps from moving opportunities back to earlier stages.
ISPICKVAL(PRIORVALUE(StageName), “Closed Won”) &&
NOT(ISPICKVAL(StageName, “Closed Won”))
6. Require Case Reason When Status = Closed
When closing a case, make sure users specify the reason.
AND(
ISPICKVAL(Status, “Closed”),
ISBLANK(Reason)
)
7. Account Must Have Industry Specified
A simple but often overlooked rule to keep accounts categorized.
ISBLANK(Industry)
8. Prevent Duplicate Names for Key Records
Stop users from creating duplicate “Project” names in a custom object.
Name = PRIORVALUE(Name)
(In practice, this is better handled with Duplicate Rules, but validation rules can provide an extra layer of protection.)
9. Phone Number Must Be 10 Digits
Ensure consistency in phone number formats.
NOT(REGEX(Phone, “^[0-9]{10}$”))
10. Prevent Lead Conversion Without Email or Phone
Before converting leads, make sure they have at least one valid contact method.
AND(
ISCONVERTED,
ISBLANK(Email),
ISBLANK(Phone)
)
Best Practices for Validation Rules
- Keep error messages clear and user-friendly. Instead of “Field cannot be blank,” say “Please enter a phone number when Lead Source = Phone Inquiry.”
- Test thoroughly. Use different scenarios to ensure the rule fires only when expected.
- Don’t overdo it. Too many validation rules can frustrate users. Strike the right balance between data quality and usability.
- Consider integrations. Sometimes validation rules can block data loads or API integrations. Use checkboxes like “Bypass Validation” for admins or integrations.
Conclusion
Validation rules are more than just error messages — they’re a proactive way to ensure data quality, compliance, and better business processes. By implementing these 10 must-know rules, Salesforce admins can significantly improve their org’s reliability and user adoption.