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
Jonathan Wolff 7Jonathan Wolff 7 

Errors when deleting Apex Classes through workbench

Hello I tried to delete an apex class by using destructiveChanges.xml and package.xml which I added to a zip-file. I deployed it to my workbench and got these errors. Could you tell me what to fix, so I could delete classes without facing this error?

User-added image
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Jonathan,

The error seems related to the packaging folder. Make sure you have package.xml in your root directory from where you are deploying the metadata.

See related:  https://salesforce.stackexchange.com/questions/98368/deploying-destructivechanges-xml-error-parsing-package-xml 

If this solution helps, Please mark it as best answer.

Thanks,
Jonathan Wolff 7Jonathan Wolff 7
Hi, yes have a look. 

Package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <version>51.0</version>
</Package>


destructiveChanges.xml:

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



In addition i got this message:

User-added image
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Jonathan,

In the destructiveChanges.xml the version is missing. Please use the below package for destructivechanges.

Remaining all looks good. I created a class with same name and deployed destructive pacakge and it worked in my personal org
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Parameter_class</members>
        <name>ApexClass</name>
    </types>
    <version>51.0</version>
</Package>


If this solution helps, Please mark it as best answer.

Thanks,
Jonathan Wolff 7Jonathan Wolff 7
Hello, thank you for the help. My problem was, that I did not delete the test class with it :) Now its working