How to Disable or Delete an Apex Trigger or Class from Production Organization ?

Apex code can’t be modified directly within a Production organization, so it requires steps using Developer tools, like the IDE.

Steps to Remove or Disable Apex Classes/Triggers

1. IDE should be installed.
2. Connect to the Production Instance using the IDE and find the class or trigger that you want to delete.
3. Open the matching .xml file, and change the Status XML tag from Active to Deleted.



4. Or to disable the trigger change it to Inactive.
Note: Apex class Status can only be changed to “Active” or “Deleted,” not “Inactive”.
5. Save the file.
6. Select the two files (Code and XML) using “Ctrl-click,” and then right-click on one of them.
7. Select | Save to server. (To delete in connected org.)

To delete in another org

8.Select | Deploy to server.
9. Provide your credentials for the destination org and follow the steps.

Senior Salesforce Architect
In Connect me on LinkedIn
twitter Follow me on Twitter @apexcoder
blogger Subscribe to my blog
email Email me

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s