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

How can I active a trigger

I did a trigger on enterprise version sf with eclipse. which can't edit trigger on sfdc.
I can upload this trigger from eclipse to sfdc. but I can't upload the active config. I config the trigger.xml to <active>true<active> and upload it. but it doesn't work. In server the trigger is still deactive.
How can I active the trigger?

I was also facing the issue. what I did was  went to the setup and then the Sobject where the trigger was made and then select the Active check box on edit and then save it. and then before deploying sync with the server. and then upload it... it helped for me... I think it will also help you.

Thanks and regards
I can't edit the trigger in setup->opportunity->trigger. It's an enterprise version, it only can be upload by eclipse.
It's so bad......

you must have developed the trigger in the some dev or sandbox instance and then you are trying to deploy it on the  enterprise instance. I was telling you to perform the steps in the dev or sandbox instance and then deploy the deactivated trigger in the enterprise instance.

Thanks and regards
Annoying, isn't it? The fact that we can't edit and delete triggers/classes is completely ridiculous. I guess you have to fork out the big bucks just so they'll enable the link.

Anyhow, in the Eclipse IDE, there should be an XML file that is associated with your trigger. If you open it, you will see a place where you can change active from false to true.

That should do it for you.

make trigger active in cl;icking the checkbox in particular object
If he can't edit the trigger through the Salesforce interface, he can't check the box. Salesforce graced all of us measly Enterprise users with the power to use Apex but not edit/delete anythiung through the Salesforce UI. I guess they had to leave something to the just Unlimited users.

The only way to do it is by changing the XML in Eclipse prior to deploying it.
You're totally right. My problem is same as you described.
I don't have permission to add/edit any triggers. And my role is administrator.

I had set <active>true</active> in eclipse but always failed to upload it to server.
The only way I've gotten this to work is to use Eclipse against the Sandbox and then, once I have verified it all work and my code coverage is good, then deployed to the production server using the option from the Apex/ menu in Eclipse.

What error are you getting?

MikeD13 wrote:
If he can't edit the trigger through the Salesforce interface, he can't check the box. Salesforce graced all of us measly Enterprise users with the power to use Apex but not edit/delete anythiung through the Salesforce UI. I guess they had to leave something to the just Unlimited users.

The only way to do it is by changing the XML in Eclipse prior to deploying it.

That doesn't work either.  I'm using enterprise and I can deactivate triggers in the sandbox by updating the xml, works fine there.  But then deploying the trigger to production will not deactivate it, Eclipse, Ant, nothing does it.  The only way I've been able to "deactivate" a trigger in production is to comment out the entire trigger body.  Salesforce please fix this!

Yeah, forgot about that. I haven't tried deactivating a trigger using this method. Previously, when I had to deactivate a trigger, I commented out the code the way you did.

I'm going to keep asking this until someone in the know answers...

Message Edited by MikeD13 on 03-19-2008 01:31 PM
i'm a little late to the party on this one, but this thread describes my current situation pretty well.  in short, i find it exceedinly difficult to deploy/update/activate triggers reliably in a production instance.  got everything to work well enough in dev, but the move to prod has been a no-go so far.  trigger is there, but it's not active.  i've tried messing with the xml file, but it doesn't seem to be updating the trigger in prod.

futhermore, this whole test-coverage thing is a bit shady.  i run the tests in eclipse - 94% - great.  I try to deploy to prod, and it tells me that my test coverage is only 14%.  this is painful.

any insight is most welcome...

I just got off the phone with Salesforce support who informed me that the only way to deactivate a trigger is through Eclipse or Ant. I told them that I felt this was ridiculous since:
1) I am rarely successfuly when dropping/deactivating triggers through these interfaces
2) Salesforce doesn't even support either of these products

This has been submitted as an idea in the Idea Exchange but it hardly has any points (Log in and promote it so they fix this issue.).

It still irks me that we even need to ask for this feature... this should be a given. If you need a trigger deactivated/deleted due to some issue, the last thing you want to have to do is load up an IDE, make changes and then deploy it. Why not just let us uncheck the IsActive box?!?! Is it really that hard??!

Well they are wrong, don't know their own product very well.  Neither Eclipse nor Ant will deactivate a trigger in a production Enterprise Edition org.  I have been around the bend with this and the only way I've found is to 1) delete all the code and leave an "active" empty trigger in production, or 2) comment all the code and leave an "active" commented-empty trigger in production, or 3) play some tricks with checkboxes or profiles or some other hack.

There isn't a way to deactivate a trigger in production via any tool or the UI.  Once you deploy, you have a permanently active trigger to deal with and that's a huge problem.


Do you mean this link?
I open the link you provided, but still can't understand how to active it. I can't understand his meaning. Can you describe it in normal sentence?

Message Edited by Kunlun on 03-26-2008 05:02 PM
The link doesn't provide a way to activate triggers. It's a feature request for Salforce. The original poster is requesting that Salesforce adds this ability to their product. You need to promote the idea (click the promote button) so it will have more points and hopefully draw the attention of Salesforce.
SF helper's reply is like below:

Why can't I create, edit or delete Apex triggers or classes in Salesforce?

Only Developer Edition, Sandbox, and Trial organizations have the ability to create, edit, and delete Apex classes and triggers directly in the Salesforce user interface. Unlimited Edition and Enterprise Edition production organizations can execute Apex and can view Apex in the user interface, but modifying Apex in the user interface is not allowed.


The Apex classes and triggers should first be written in a Developer Edition, Sandbox, or Trial organization along with the appropriate test methods that test at least 1% of triggers and 75% of classes. To deploy Apex into a production organization, a user with the Author Apex permission must deploy the triggers and classes using either the compileAndTest() or deploy() Metadata API methods which can be accessed with either the Apex Development Tool based on Apache ANT or the IDE based on Eclipse. 


Both of these tools are available by going to Setup | Develop | Tools. For more information about Apex, please see the Apex Developer's Guide at

Why Cant I see the New Button in Apex Code Trigger section?

Sometimes, a customer might ask why they can not see the NEW button in Apex Code trigger section in Live Production.

You can add, edit or delete Apex using the Salesforce user interface only in a Developer Edition or sandbox organization.


To activate the Trigger Function in live production environment, you will need to use either the Salesforce ANT Tool or Apex Toolkit for Eclipse to deploy.

More Deployment instructions are in the attached Apex Developer's Guide

For the latest Apex Developer Guide go to


I tried eclipse to upload Apex code, but I failed again and again. I only can upload it with command out all code.
This kind of problem had involved me into a deep trap. I had spent too much time on that. It sucks so much.