Data

How To Bypass Automations & Validations in Salesforce for Mass DML Operations

In Salesforce, it is not uncommon to mass insert, update or delete records from time to time. This may be required to onboard new business units, departments or applications, fix bugs, patch existing records with certain values, accommodate changes in data model, archive and delete data etc.

But as we process data in bulk, validation rules and automation that are defined in Salesforce kicks in. This not only slows down the DML operation but may also lead to undesired processing like triggering emails to internal and external users, sending interface messages to backend systems and cause process and/or data integrity issues.

One of the ways around this problem is to deactivate these automations and validations, run your mass DML operations and reactivate. However, the challenge with this approach is that first it will require a downtime for your users and second it will take time and effort to deactivate and reactivate. This approach may be okay if these mass DML operations are not frequent, the number of validations and automations are not high, and your business does not mind a downtime. 

Bypass Automation & Validations in Salesforce for mass DML Operations

Or the second option will be to bake in some kind of mechanism in your solution to not to run these automations & validations for mass DML operations. Something like diverting heavy vehicles to take another route.

And this is where we can use “Custom Setting” of “Hierarchical” type in  Salesforce The benefit of using custom setting of hierarchal type is that you can define it at the org level and then override it at the profile level or user level. So for the scenario mentioned above, we can use a custom setting to bypass the validations and automations for a particular user and then use that user to perform mass DML operations.

In this step-by-step guide we will explore how to use the hierarchy custom setting to bypass validations and automations without impacting the normal operations. Like how to bypass. Like how to bypass:

  1. Validation Rules
  2. Workflow Rules
  3. Process Builder
  4. Salesforce Flows
  5. Apex Triggers

So, let’s grab a cup of coffee and dive in.

NOTE: Certain sections of the guide will appear as locked in the free preview. You can download the unlocked version of the guide in PDF format by subscribing to our “All Access” Pass through the link below.

Not an “All Access” Pass Member Yet?

Get Download Access to this & 150+ More Step-by-Step Guides with “All Access” Pass. A simple and single plan to access our entire library of courses, guides, workshops & masterclasses on Salesforce.

References & Useful URLs

Upload Data to Salesforce from CSV

#1MinuteTip Another useful app from Salesforce Labs on AppExchange. Called CSV2Salesforce this app will enable you to generate records for any of your Salesforce objects, with ease via a drag and drop CSV upload. No need to give users too many permissions for this task!

This solution allows you to populate a CSV file with your field APIs as column headers and the rows as the record data. Drag and drop/upload your CSV, state which object you wish to upload and away you go!

References & Useful URLs

Reasons for Not Backing Up Your Salesforce Data

#1MinuteTip  If you are not taking regular backup of your Salesforce data, there can only be two reasons:

1. You don’t know how to do it
2. You are lazy to do it

Let’s address the first one right here, right now. Take a look at the attached screenshot and you will know how to do it. But the question is when will you address the 2nd one?

Reasons for Not Backing Up Your Salesforce Data
Scroll to Top
Introducing All Access Pass