Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I delete an Apex class in Salesforce Enterprise Edition using Eclipse?

Tags:

salesforce

How do I delete an Apex class and trigger in Salesforce Enterprise Edition using Eclipse?

like image 697
Ashwaq Syed Avatar asked Dec 16 '22 17:12

Ashwaq Syed


1 Answers

In order to delete a trigger from a production org using eclipse you will need to use the following steps(assuming you have a sandbox org):

  1. Through the web interface in your sandbox org, inactivate the trigger
  2. Refresh your sandbox project in eclipse and deploy the inactive trigger to production
  3. Refresh your production project in eclipse, right click on the trigger and select delete
  4. Accept the option to delete from server

I believe the above steps will work, however I have only ever removed components from a production org using destructive changes & the Ant Migration Toolkit.

To use the Ant Migration Toolkit for a destructive change you would need to setup the destructivechange.xml file to look similar to this:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>MyTrigger</members>
        <name>ApexTrigger</name>
    </types>
    <version>21.0</version>
</Package>

There are full instructions on how to propogate destructive changes on developerforce.

like image 194
lnediger Avatar answered May 25 '23 14:05

lnediger