function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Claire SunderlandClaire Sunderland 

De-activate trigger in production

I am trying to de-activate an apex trigger in production but it keeps failling. I have tried 2 different methods:

1. De-activating in sandbox and pushing to production
2. Using force.com IDE to delete. I am able to delete in my sandbox environment but I keep receiving an error when I try to deploy it to production.

Here is the error:

User-added image 
Best Answer chosen by Claire Sunderland
Raj VakatiRaj Vakati
Looks like you Test class is failing ..  Remove assert statmenets from the test class and migrate the test class along with the trigger .. 


or First Migrate the test class 
and then migrate the trigger 

All Answers

Raj VakatiRaj Vakati
Looks like you Test class is failing ..  Remove assert statmenets from the test class and migrate the test class along with the trigger .. 


or First Migrate the test class 
and then migrate the trigger 
This was selected as the best answer
karthikeyan perumalkarthikeyan perumal
Hello, 

make inactive the trigger first and do the deployment. do not include any test class in this deployment via chnage set  or eclipes IDE.

Then do the other deployment in order to identifiy the which test class having issue while moving from sandbox to production. 

Thanks
karthik
 
Amit Chaudhary 8Amit Chaudhary 8
Please check below post for same
1) https://help.salesforce.com/articleView?id=000005417&type=1

Follow below step:-
1) Deactivate Trigger in sandbox
2) Remove or comment trigger related code from Test class. As trigger related Assert will fail.
3) Then deploy trigger and test class together in production.

Let us know if this will help you