Essentially you just need to deploy the triggers folder in Eclipse minus the one you don't want — then you have the option to remove it. A faster solution to disable the trigger might be to just comment out it's contents if you're not comfortable with Eclipse. It boils down to putting a /* after the first brace ({) and then */ before the last one.
If there are comments using this syntax in the trigger you'll need further tags around them, in which case you may find it simpler to just start every line of the body with //:
trigger Contac_AfterInsert on Contact (after insert)
{
// comment
// out
// all
// of
// this
// stuff
}
Note: The first brace might be at the end of the first line of the file.
Hi LiorG,
Essentially you just need to deploy the triggers folder in Eclipse minus the one you don't want — then you have the option to remove it. A faster solution to disable the trigger might be to just comment out it's contents if you're not comfortable with Eclipse. It boils down to putting a /* after the first brace ({) and then */ before the last one.
If there are comments using this syntax in the trigger you'll need further tags around them, in which case you may find it simpler to just start every line of the body with //:
trigger Contac_AfterInsert on Contact (after insert)
{
// comment
// out
// all
// of
// this
// stuff
}
Note: The first brace might be at the end of the first line of the file.
Thanks Matt, but I can't even edit my trigger in production. Is there no other alternative to Eclipse?
That's odd, as an admin you should be able to, it usually just runs all tests after making the change (i.e. does the same as a deployment).
You can move changes from a sandbox through changesets, I don't know personally if they can be used to remove code though.
For deleting or inactivating the only way i know is to update the metadata of the trigger from Sandbox through eclipse,
Then update the xml in metadata as:
<status>Active</status>
to
<status>Inactive</status>
<status>Deleted</status>
Then save the trigger in sandbox and deploy it to the production.
Didn't know you could do that — I always just deploy the trigger directory without the trigger in question — thanks for the tip!