How to deactivate trigger in salesforce production

image

How to deactivate a trigger in Salesforce using metadata

  • Open up the metadata file for the trigger.
  • If your trigger is called AccountTrigger then your metadata file will be called AccountTrigger.trigger-meta.xml
  • Now set the status property to Inactive
  • Once you deploy the file the trigger will be deactivated

Turn off trigger in production org
  1. Alternative: edit the triggername. trigger-meta. xml in an existing project and change the status node to false: <status>Inactive</status>.
  2. Save the change locally.
  3. Deploy the trigger to production.

Full
Answer

How do I delete a trigger in Salesforce?

Click on an object for example Employee object. Then scroll down and you will see a section triggers where you will find list of triggers created for that object. Select the trigger which you do not need and delete.

Is it possible to deactivate a trigger in production?

In fact, there has to be a way to deactivate a trigger in production or it severely limits the use. I tried spaceman’s method of deploying an inactive trigger and it still didn’t work.

How do I de-activate an apex trigger in production?

Currently, there is no way to de-activate an Apex trigger in production. Please allow this. * A new bug is found, causing an unhandled exception. You want users to be able to continue saving records that cause the exception, while you troubleshoot the bug in a dev/sandbox environment.

How do I deploy an inactive trigger in prod?

If you want to deploy inactive trigger in prod then you need to change code coverage first. Please check below post. I hope that will help u:- How do I disable a Trigger in a production environment? Important: You must consider the consequences of disabling a trigger in the production environment during work hours.

image

Leave a Comment