function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TryForce.ax1449TryForce.ax1449 

Remove all classes from org using Ant

Hi

 

I want to remove all(say 100) classes from my org using ant. So i can not specify the name of individual class in destructiveChanges.xml file. Hence i tried to create it like below:


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

 

But i am getting error "No ApexClass Named: * found"

 

can someone please help me on this?

 

Thanks in Advance!!!!

gaisergaiser

destructiveChanges.xml does not work with wildcards.

You will have to mention every single class in the file.

TryForce.ax1449TryForce.ax1449

But I do not want to specify every class name. Is there any other method to do this?

gaisergaiser

If it is a one-off activity then you could use Force.com IDE for Eclipse.

 

If you need to do this regularly or can not use Force.com IDE and have to stick with Ant then:

1. use Ant "listMetadata" task to retrieve list of all classes

2. write that list in destructiveChanges.xml file - whether you just copy/paste or write a script to populate destructiveChanges.xml is up to you