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

Ant deploy to permanently remove custom objects with destructive changes


Does anyone know if the Ant migration tool supports the new purgeOnDelete (introduced in summer 11) attribute of the deploy metadata command. I have downloaded the latest ant-salesforce.jar from my DE and run a deploy command and I get the following error.


 sf:deploy doesn't support the "purgeOnDelete" attribute


purgeOnDeletebooleanIf true, the deleted components in the destructiveChanges.xml manifest file aren't stored in the Recycle Bin. Instead, they become immediately eligible for deletion.

This field is available in API version 22.0 and later.

This option only works in Developer Edition or sandbox organizations; it doesn't work in production organizations.


Did you ever determine where all this works?  I'm happy to see there's an option for dev orgs, but we want to run our automated nightly tests against our app deployed as a managed package, and I'm concerned that we won't be able to use this in our nightly environment.  We really need to have that be deployed into a "scorched earth" (completely pristine) environment to ensure we're not getting metadata conflicts or false positives from mid-development cycle changes.


Right now our backup plan is to use something like Selenium or httpunit/htmlunit to automate emptying the recycle bins, but that seems REALLY hacky to do the equivalent of a "make clean" on an org!




Did you get any solution for this? I also need to use PurgOnDelete but i am not able to do this even with latest version of Migration Tool.


Please update.

ForceMantis (Amit Jain)ForceMantis (Amit Jain)

I was also facing this issue and have solved it using a custom approach. Detailed steps are on my blog. I have also shared code for this on GitHub