Salesforce Validation Rule Bypass Using a Custom Permission

Bypassing Salesforce Validation Rule

Salesforce Validation Rules ensure that business processes are adhered to and that data is entered in a consistent format. Validation Rules run when a record is saved. A user is notified of invalid or missing data entry after clicking the Save button. Custom text instructs the user as to what needs to be changed.

What if a specific set of users, regardless of their Profile, need to be able to bypass a Salesforce Validation Rule?

The challenge is that you cannot directly access a Permission Set within a Validation Rule without using Apex code.

Here’s the code free, a.k.a declarative, process for allowing certain users to bypass a Validation Rule.

1. Create a Custom Permission

Salesforce Custom Permission

2. Create a Permission Set and mark the Custom Permission as active in that set

Salesforce Permission Set

3. Assign users to the Permission Set who should be able to bypass the Validation Rule

4. A a line to the Validation Rule that references the Custom Permission

In our example, the line is $Permission.Submit_Leads_Bypass = FALSE

Salesforce Validation Rule

Any users who are assigned to the Permission Set will not be subject to enforcement of the Salesforce Validation Rule.

About the Author

Brandon StauberBrandon Stauber is Practice Director at Saxa Solutions, a Salesforce partner that specializes in the healthcare and life sciences industries. Brandon is a Certified Scaled Agile Practitioner and a Certified Scrum Master. Saxa is also the publisher of Sapience MD, a physician database for Salesforce. Learn more about Sapience MD.

Brandon Stauber LinkedIn