You need to sign in to do that
Don't have an account?

HELP! I need to disable apex trigger already in production
I know there are some other posts about this, but I cannot make much sense of them I am new to apex and salesforce, learned a considerable amount in the time I've been working with it, but right now Im up against a wall, and its BAD
I, for whatever reason, could not make opportunities in my sandbox, could not figure out why, but wanted to try this trigger. So like a fool I put it to production. No nobody can create or edit anything [a Work order - custom object we use to project details] We NEED this to work. My company is at a halt, I NEED to remove or disable this trigger asap.
I tried to mark it as inactive in sandbox, and push it to production, but it says "Average test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required." I have NOO idea what this means and no time to figure anything out. Needless to say - I am freaking out. PLEASE someone help.
Hi.
To make trigger in inactive or active
1.Download the trigger from production using the IDE.
2.After that double click the xxXXX.trigger-meta.xml.
the meta xml file looks like this
<?xml version="1.0" encoding="UTF-8"?>
<ApexTrigger xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>24.0</apiVersion>
<status>Active</status> ----> change this to Inactive
</ApexTrigger>
In the status xml tag you can set Inactive to de-activate the trigger.
3.Deploy the trigger to server.
thats it your tigger will not work in production.
cheers
suresh
All Answers
The quickest way to disable the trigger is to comment out the code inside the trigger. So if your trigger is like this:
Just comment everything inside the trigger as using the block comment facility /* */
Your trigger basically does nothing. Now deploy this code to prod, and you should be okay atleast for the near future.
- anup
I've tried that, it won't let me save it. it says "Error: Compile Error: unexpected token: '<EOF>' at line 0 column -1"
I downloaded and installed the Force.com IDE, it wouldnt let me delete the trigger. did not say why..or at least not very descriptly. It just said aborting delete. It wont let me block out the code either. It tells me "Expecting a left parantheses founD '{' "
Whyy is this so difficult. I. Want. This. Trigger. Gone.
Hi.
To make trigger in inactive or active
1.Download the trigger from production using the IDE.
2.After that double click the xxXXX.trigger-meta.xml.
the meta xml file looks like this
<?xml version="1.0" encoding="UTF-8"?>
<ApexTrigger xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>24.0</apiVersion>
<status>Active</status> ----> change this to Inactive
</ApexTrigger>
In the status xml tag you can set Inactive to de-activate the trigger.
3.Deploy the trigger to server.
thats it your tigger will not work in production.
cheers
suresh
That is exactly what needed to happen, although I selected delete instead of inactive. trigger is gone, and the problem with it. Thanks!
Happy to hear you need the same.
please mark my reply as answer so that others can be helped very easiy
cheers
suresh
There is no line 25 in the trigger!! There are only 22 lines.
I also tried editing the trigger in the sandbox and commenting out the code, but I get the same error when I upload and validate/deploy.
The trigger was created in 2010 - could there be a version problem?
I have Eclipse loaded but have no idea about how it connects to the IDE - sorry but have only used it once with much struggling and have forgotten.
If I just download from my SF instance all it gives me is the trigger code, not the xml, so am needing some help please...
5 Ways to Deactivate a Trigger in Production (https://sfdcfanboy.com/2017/11/23/a-tip-a-day-23-5-ways-to-stop-trigger-in-production/)
3 Ways to Delete an Apex class from Production (https://sfdcfanboy.com/2017/11/24/a-tip-a-day-24-3-ways-to-delete-an-apex-class-from-production/)