You need to sign in to do that
Don't have an account?

How to delete an apex class
Hello dear community, I was wondering how exactly to delete an apex class because obviously you can't do that in the production area, I already tried deleting it from my sandbox which worked but it didnt have any impact on my actual production area.
Thanks in advance
Thanks in advance
2. Migrate the class to production.
3. use ANT destruction command for the class.
it will work
Thanks
Shaijan Thomas
- Create new project in eclipse and download all the source code from production
- Open the meta-data of the file you want to delete in production and change the status to Delete
- Click save to server to delete the class in the production
I strogly recommend this method to try first in the dev or sandbox instance and get comfortable and then do the same step in production.From the Knowledge Article (https://help.salesforce.com/apex/HTViewSolution?id=000006188&language=en_US):
- Force.com IDE should be installed and working.
- Connect to the Sandbox Instance using the IDE and find the class or trigger that you want to delete.
- 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.
- Apex class Status can only be changed to "Active" or "Deleted", not "Inactive".
- Save the file.
- Select the two files (Code and XML) using Ctrl-click, then right click on one of them. Select Force.com > Deploy to server.
- Provide your credentials for the production org and follow the steps.
Does this help? Let me know if you have trouble in locating the xml part of the file.
--
Abhi
@Bernd, more useful discussions - http://salesforce.stackexchange.com/questions/23229/best-way-to-delete-unused-apex-classes-and-triggers-in-production
There are always multiple solutions in Force.com ;)
--
Abhi
In the developer Edition I tried this :
1: Open Setup
2; Pltform Tools>Custom Codes> Apex Classes> Locate the Class
3: Delete
Although it deleted the class for me but I have seen nobody suggested it yet could you please help me to know is it a recommended step or not??