I had an almost duplicated question and landed here. I want to remove a class using only Force.com IDE (Eclipse) from my org organization . Inediger described how to deploy a set of destructive changes using the Ant Migration Toolkit and figured out how to do it in the Force.com IDE. In my attempts with Force.com IDE version 20.0, steps 3 and 4 of Inediger will not let you remove the class / trigger in your org organization.
Here's a natural attempt to remove a class in the Force.com IDE:
- Select a class. Click delete.
- "Do you really want to delete the file 'myClass.cls'?" ... OK
- "The requested operation will be deleted locally only locally. Would also like the resource to be deleted from the server?" ... Yes
At this point, the file is deleted from your project and your org organization, but it remains in your org organization (and the admin web interface will not allow you to delete it there) to continue:
- Deploy the server.
- Enter your business organization credentials.
- Further. Further.
- Look for your class in the list of deployment candidates, but it does not exist!
Unfortunately, your class will not be listed in the deployment candidate list because Force.com IDE has already lost this file (because you deleted it - if you recreate the class in your boat in your dev org and follow my instructions below).
We need to delete it during the production process before deleting the file locally (I think we go through the Force.com IDE, creating one of these destructive change sets and deploying it for us):
- Edit the appropriate class of the * -meta.xml file (from the Force.com IDE).
- Set the status to "Deleted": <status> Deleted </status>. Save.
- Right-click your class, Force.com | Deploy the server.
- Enter your business account credentials.
- You should see that your class is the only candidate for deployment!
- Check the box next to "Apply action"? Overwrite your class.
- Follow the path through the rest of the masters.
If you follow the Salesforce admin web pages, you will notice that the class disappears from your dev org after saving in step 2. It disappears from your org org when you get a green checkmark after step 7.
Finally, I remove the class from the Force.com IDE, as usual. When he asks me if I want to delete the file from the server, I say no, because we already took care of that. I also add / remove metadata components and remove its name to get rid of the warning message.
source share