Skip to main content

Bypasses

We reference "bypasses" in a number of these conventions.

Bypasses are administrator-defined checkboxes that allow you to massively deactivate automations and validation rules with a simple click. They avoid that awkward feeling when you realize that you need to turn them off one by one so you can do that huge data update operation you're planning.

If your validation rules bypasses look like this, this is bad:
$Profile.id <> '00eo0000000KXdC' && somefield__c = 'greatvalue'rr

The most maintainable way to create a bypass is to create a hierarchical custom setting to store all the bypass values that you will use. This means that the custom setting should be named "Bypasses", and contain one field per bypass type that you want to do.

BypassesGreat-looking arebypass administrator-definedsetup checkboxesright thatthere

allow

This setup allows you to massivelycreate deactivatebypasses automationseither andby profile or by user, like so:

This allows you to reference bypasses directly in your validation rules withby asimply simpleletting click.Salesforce Theyhandle avoidknowing whether or not the bypass is active or not for that awkwardspecific feelinguser whenor youprofile. realizeIn thatthe youvalidations needthemselves, tousing turnthis thembypass offis oneas byeasy oneas soreferencing it via the formula builder. An example for validation rules could be:

!$Setup.Bypasses__c.IsBypassVR__c && Name = "test"

As you can doalso see in the above screenshots, you can use a single custom setting to host all the bypasses for your organization, including Validation Rules, Workflows, Triggers, etc. As additional examples, you can see that huge"Bypass dataEmails" updateand operation"Bypass you'reInvoicing planning.Process" are also present in the custom setting - adding the check for these checkboxes in the automations that trigger emails, and automations that belong to Invoicing respectively, allow partial deactivation of automations based on criteria.