[SalesForce] How to delete a class from production using destructiveChanges.xml

Can any one tell me the steps to delete a class using destructiveChanges.xml

Best Answer

  1. Fulfill the PreRequisites for using the Force.com Migration tool
  2. Install the Java JRE/ JDK
  3. Install Apache Ant
  4. Copy the ant-salesforce.jar file from the unzipped file into the ant lib directory.
  5. Follow the steps at Apex deploying using Ant to understand the basic setup
  6. Construct your destructiveChanges.xml file using Propagating Destructive Changes

Sample:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>codepkg</fullName>
   <types>
        <members>SampleDeployClass</members>
        <members>SampleFailingTestClass</members>
        <name>ApexClass</name>
    </types>
    <version>26.0</version>
</Package>

Run the Force Migration tool

C:\>ant undeployCode

Here's a Video Tutorial

Related Topic