best way to delete unused apex classes and triggers in production [duplicate]

We currently have around 20 apex classes and 5 triggers which are not used in our production org. We want to delete them in our production instance. We dont have ant scripts ready yet to be used for our deployments and so we cannot use destructivechanges file. Currently our production deployments are done by our support team and they need documentation from us to do these deletes. Changesets do not allow to delete apex classes and triggers. So what is the best way to delete these apex classes and triggers from production?

Answer

You have a few options. My recommendation however, will be to use ANT and destructiveChanges.xml contrary to your post. It might take a few hours to set ANT up in your environment and in your support team’s environment, but it is a repeatable process you can run on multiple orgs if need-be.

Running the ANT script (can) be easier for your support team rather than manually deleting the classes and triggers or installing eclipse on their local machines and deleting the files that way.

If you really want to get crazy with it, and simplify it for your support team, you could even set up a CI tool that would allow a push button delete of the classes, which would fire the ant migration toolkit script to delete the files from a designated org.

More info on the destructiveChanges approach is here: http://wiki.developerforce.com/page/Propagating_Destructive_Changes

and

How to delete a class from production using destructiveChanges.xml

Attribution
Source : Link , Question Author : Buyan Thyagarajan , Answer Author : Community

Leave a Comment