Disabling validation rules, triggers and flows

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

Pearl Oyunbaatar avatar
Written by Pearl Oyunbaatar
Updated over a week 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 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 the validation 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 rules, triggers and flows.

Please note that only related validation 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 manage package metadata triggers or validation rules.)

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

Did this answer your question?