Wednesday, February 19, 2014

Deleting Salesforce apex classes from production org

Goal Scenario

Some temporary apex classes have been created in production and need to be deleted.

For change control reasons the developer does not have rights to use the Force.com IDE to achieve this.

The production administrator doesn't use Eclipse and only has the ability to do the following:
  • Manual configuration
  • Change sets
  • ANT deployments

Solution


Provide a package for ANT deployment containing only the meta files for the classes to be deleted.

Inside the meta, change the value of the status tag to Deleted.

     <?xml version="1.0" encoding="UTF-8"?>
     <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
         <apiVersion>23.0</apiVersion>
         <status>Deleted</status>

No comments: