Skip to main content Rejoignez le hackathon virtuel Agentforce pour créer des solutions innovantes et concourir pour un grand prix de 50 000 $. Inscrivez-vous sans attendre. Offre soumise à conditions.
Joe Dias (Persistent) a posé une question dans #Apex
what the the steps to delete class from production using ANT tool ?

 
2 réponses
  1. 8 sept. 2016, 12:44
    Please check below post for IDE

    1) https://help.salesforce.com/apex/HTViewSolution?id=000006188

    2) http://salesforce.stackexchange.com/questions/5776/deleting-triggers-classes-from-production

    Steps to Remove or Disable 

    1. Force.com IDE should be installed.

    2. Connect to the Sandbox Instance using the IDE and find the class or trigger that you want to delete.

    3. Open the matching .xml file, and change the Status XML tag from Active to Deleted. 

    4. Or to disable the trigger change it to Inactive.

    Note: Apex class Status can only be changed to "Active" or "Deleted," not "Inactive".

    5. Save the file.

    6. Select the two files (Code and XML) using "Ctrl-click," and then right-click on one of them.

    7. Select Force.com | Deploy to server.

    8. Provide your credentials for the Production org and follow the steps.

    Please check below post for ANT

    1) http://salesforce.stackexchange.com/questions/4058/how-to-delete-a-class-from-production-using-destructivechanges-xml

    2) http://www.salesforceben.com/way-to-delete-apex-classes-from-production/

     
  2. 8 sept. 2016, 09:37
    Fulfill the PreRequisites for using the Force.com Migration toolhttp://www.salesforce.com/us/developer/docs/daas/Content/forcemigrationtool_prereq.htm Install the Java JRE/ JDK Install Apache Ant Copy the ant-salesforce.jar file from the unzipped file into the ant lib directory.

    Follow the steps at the URL below to understand the basic setup :http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_deploying_ant.htm

    Construct your destructiveChanges.xml file, as belowhttp://wiki.developerforce.com/page/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 http://wiki.developerforce.com/page/Migration_Tool

    Answer Link:http://salesforce.stackexchange.com/questions/4058/how-to-delete-a-class-from-production-using-destructivechanges-xml

    Hope this helps
0/9000