I need your help on this one.

Need: We have several triggers that use classes and we need to disable or deactivate both the triggers and classes in production because they are causing issues with another active trigger.

Issue: I have made all of the triggers we want deactivated Status = Inactive through the use of the check box when in sandbox and also commented out my test classes. The classes are still active because I don't know how to make those inactive. The issue is that editing the triggers and classes brought the overall coverage down to 16% which is obviously too low for deployment. The triggers and classes we still want active have the appropriate code coverage but I can't deploy the the triggers and classes we want to deactivate because the overall code coverage is only 16%. A simple way would be ideal as I do not have a ton of knowledge in this arena.

1 Answer 1


Looks like the test classes are fine just that the triggers are de activated, causing the coverage to suffer. If the triggers can be refactored to determine if its running in test context, and bail out if not, in case of triggers that you want to deactivate. i.e. if (!Test.isRunningTest()) return; . Idea is to let the tests run but not otherwise even when they are active. Long term solution will be to, move the trigger code to respective classes, get a Apex trigger framework. Control unwanted invocation. For reference may read blogs of Dan Appleman, Hari Krishna.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .