0

I'm trying to uninstall/delete packages from my salesforce org using ANT (Since there are lot of dependencies) how can I achieve this?

When I run ant undeployCode or undeploypackage it shows "successful" but the package is still there how come?

Package.xml

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

destructivechanges.xml

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

build.xml

<target name="undeploypackage">
 <sf:deploy username="${sf.username}" password="${sf.password}"    sessionId="${sf.sessionId}" serverurl="${sf.serverurl}" singlepackage="true" deployroot="removecodepkg"/>
</target>
<target name="undeployCode">
  <sf:deploy username="${sf.username}" password="${sf.password}" sessionId="${sf.sessionId}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" deployRoot="removecodepkg"/>
</target>
  • Does a manual uninstall also fail? Its very common for package uninstalls to fail because local code/components have been added that depend on the managed package and that blocks the uninstall. That code/components need to be removed first. Worth eliminated that problem first if it exists. – Keith C Jul 11 '16 at 8:45
  • Yes it does, and I have many Installed packages that have lot of dependencies, the only thing I don't understand is that from command line it shows "successful" while it isn't. – d_k Jul 11 '16 at 9:09
  • Yeah that isn't good. – Keith C Jul 11 '16 at 11:07
0

Got It! What I did was uninstalled unmanaged package manually (Since Uninstalling/Removing it VIA desctructiveChanges.xml needs NameSpace to do so which an unmanaged package doesn't have one)

AND for Managed Package this is what I did

Removed all the dependencies VIA ANT first and then....

    <types>
        <members>NAMESPACE</members>
        <name>InstalledPackage</name>
   </types>

This worked well!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.