I want to deploy the destructive changes. I have tried the below options but it doesn't work for me:
Option 1: sfdx force:mdapi:deploy -f destructiveChanges.zip -u orgname
Option 2: sfdx force:source:deploy --manifest .\destructiveChanges\package.xml --predestructivechanges .\destructiveChanges\destructiveChangesPre.xml
I have created a folder :
descrtuctiveChanges
--package.xml
--descrtuctiveChanges.xml
--descrtuctiveChangesPre.xml(for force:source:deploy)
Earlier with a version(7.133.0) of sfdx cli the force:mdapi:deploy was working in Sandbox but not working in Production. So I have updated cli version today.
Now facing the below error in with above both commands:
ERROR running force:mdapi:deploy: versions.map is not a function
My XML files are: package.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>52.0</version>
</Package>
destructiveChanges.xml OR destructiveChangesPre.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Visit_Reports__c</members>
<name>CustomObject</name>
</types>
</Package>
And I also tried the zip file using workbench. I am able to delete the custom object on Sandbox with the option NoTestRun. But on production, it does not allow us to deploy with NoTestRun. Can anyone please suggest to me how I can achieve this?
Note: I tried by adding one test class in package.xml and adding that test class in src/classes/testclass and metadataOfTestclass - and then created a zip file with that but it gives me an error:
No Package.xml found
My pacakage.xml with test class:
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Test_dalShift</members>
<name>ApexClass</name>
</types>
<version>52.0</version>
</Package>
And inside src, I have test class added as given here
Also tried with RunLocalTest, but same issue.
Please help me here. Thanks