How to delete a class in production in Salesforce using IDE in Eclipse?

1. Install IDE in Eclipse.

2. Connect to the Sandbox Instance using the IDE and find the class or trigger that you want to delete.

3. Open the matching .xml file change the Status XML tag from "Active" to "Deleted" if you want to remove the trigger or class, or to "Inactive" if you want to disable the trigger.

4. 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, then right click on one of them. Select > Deploy to server.

7. Provide your credentials for the production org and follow the steps.

1 comment:

  1. HI I am trying to do the same, it show some dependency on a trigger which calls this class. I tried to inactivate the trigger/ comment the piece of code and deploy , then too it is showing the error. can you suggest.