Skip to main content
Disabling validation and duplicate rules, triggers and flows

Gearset can disable validation and duplicate rules, triggers, flows and process builders for you before you start your data deployment

Pearl Oyunbaatar avatar
Written by Pearl Oyunbaatar
Updated over 3 months ago

Active validation rules in the target org are a frequent cause of FIELD_CUSTOM_VALIDATION_EXCEPTION errors in data deployments. Sometimes it's just not possible to update your existing records so that they conform to your new validation rules.

Active duplicate rules in the target org can cause errors if you are trying to deploy test data into your sandbox that contains duplicate records.

Active triggers in the target can cause System.LimitException: Apex CPU time limit exceeded if they fire on lots of records in your deployment. Any unhandled exceptions thrown by triggers will also cause deployments to fail.

Active flows and process builders in the target org can also cause errors during data deployments, such as CANNOT_EXECUTE_FLOW_TRIGGER: We can't save this record because the process failed.

One of the ways you can avoid these types of error is to disable any rules, triggers and flows before you run the deployment. Gearset can help you do that without the need to navigate away to your org.

Click the View and disable rules button in the bottom-right of screen:

  • For Data Deployment it will be on the data masking page to prepare a special metadata comparison.

  • For Data Restoration it will be on the Data restore Summary page.

Once it's ready, you'll be able to view a list of validation and duplicate rules, triggers and flows.

Please note that only related rules, triggers to the specific data that’s being imported, and all flows will be listed. Choose what you want to disable and then select Start deactivation deployment.

(Note: these will not include managed package metadata triggers or validation rules. Duplicate rules with custom filter logic that act on a custom field can also not be deployed because of a Salesforce issue)

Once that is done, you will get a success screen.

Once you've finished your data deployment, you can re-enable the rules, triggers and flows by rolling back the metadata deployment via the deployment summary:

Rollback is usually a Teams feature, but this special type of deployment can be rolled back by anyone with a Starter, Teams, or Enterprise license.

You can always find this deployment in the Deployment history in the Gearset app. You can always filter that list to find the disabled rules for data deployment.

And then click on rollback button to enable the rules, triggers, and flows.

Did this answer your question?