5

I'm attempting to deploy a destructiveChanges.xml file. When I include

<types>
    <members>Populate_Unit_Price</members>
    <members>Line_Item_Updated</members>
    <name>WorkflowRule</name>
</types>

The deployment fails and I receive an error stating it can't find those workflows, but when I remove the those lines the deployment completes successfully. I've also attempted with dot-notation; (i.e. <members>Line_Item__c.Line_Item_Updated</member>).

My understanding is that when using destructiveChanges.xml:

If you try to delete components that do not exist in the organization, the rest of the deletions will be attempted.

Why would the destructiveChanges deployment fail if it didn't find a component to delete? I even included rollbackOnError="False" in the target of the build.xml.

Error Message:

All Component Failures:
1.  destructiveChanges.xml -- Warning: No ApprovalProcess named: Line_Item__c.Approve_Unit_Price_Change found
2.  destructiveChanges.xml -- Warning: No WorkflowRule named: Line_Item_Updatedfound
3.  destructiveChanges.xml -- Warning: No WorkflowFieldUpdate named: Line_Item__c.Reset_Price found
4.  destructiveChanges.xml -- Warning: No WorkflowFieldUpdate named: Line_Item__c.Copy_Unit_Price found
5.  destructiveChanges.xml -- Warning: No WorkflowFieldUpdate named: Line_Item__c.Update_Stock_Inventory found
6.  destructiveChanges.xml -- Warning: No ValidationRule named: Line_Item__c.Validate_Quantity found
7.  destructiveChanges.xml -- Warning: No CustomField named: Line_Item__c.Unit_Price__c found
8.  destructiveChanges.xml -- Warning: No CustomField named: Line_Item__c.Invoice__c found
9.  destructiveChanges.xml -- Warning: No CustomField named: Line_Item__c.Quantity__c found
10.  destructiveChanges.xml -- Warning: No CustomField named: Merchandise__c.Price__c found
11.  destructiveChanges.xml -- Warning: No CustomField named: Invoice__c.Invoice_Total_del__c found
12.  destructiveChanges.xml -- Warning: No CustomField named: Invoice__c.Status_del__c found
13.  destructiveChanges.xml -- Warning: No CustomField named: Merchandise__c.Quantity__c found
14.  destructiveChanges.xml -- Warning: No CustomField named: Line_Item__c.Line_Item_Total__c found
15.  destructiveChanges.xml -- Warning: No CustomField named: Line_Item__c.Merchandise__c found
16.  destructiveChanges.xml -- Warning: No CustomObject named: Invoice__c found
17.  destructiveChanges.xml -- Warning: No CustomObject named: Merchandise__c found
18.  destructiveChanges.xml -- Warning: No CustomObject named: Line_Item__c found
19.  destructiveChanges.xml -- Warning: No WorkflowRule named: Populate_Unit_Price found
*********** DEPLOYMENT FAILED ***********
Total time: 11 seconds

I've already successfully deployed the destructiveChange by manually deleting the WFRs in the original question, then deploying the file. All of these errors are components that are already deleted and no longer on the server.

Including my target as well:

<target name="DelVFPack">
  <sf:deploy username="${sf.undeploy1}" password="${sf.pwdeploy1}" serverurl="${sf.urldeploy1}" maxPoll="${sf.maxPoll}" deployRoot="src" purgeOnDelete="true" rollbackOnError="False"/>
</target>
5
  • Can you add the error message that you are getting? WorkflowRule is not a metadata type that I have seen before so it could be complaining about that.
    – BarCotter
    Dec 5, 2014 at 15:23
  • Thanks @BarCotter, I've added the error message. The WorkflowRule metadata type is found here. I found that's the correct type via this StackExchange questions.
    – zainogj
    Dec 5, 2014 at 15:32
  • They are all warnings and not errors. Are you sure that the deployment is failing?
    – BarCotter
    Dec 5, 2014 at 15:34
  • 1
    Yup - sorry again, edited to include the deployment failure.
    – zainogj
    Dec 5, 2014 at 15:36
  • I'm not going to close this out in case it happens to anyone else, but it appears to be a one time issue. I've tried a Destructive Change deployment with components I knew weren't in the environment and it worked successfully, so it's possible there was an error somewhere on my side.
    – zainogj
    Dec 19, 2014 at 13:44

2 Answers 2

5

Set the ignoreWarnings attribute to true to prevent sf.deploy from failing when components in destructiveChanges.xml are not found, e.g.

  <sf:deploy username="${sf.undeploy1}" ... ignoreWarnings="true" />
1
  • Thanks @xn., Unfortunately I can't confirm if this works for me as I don't have the destructive change file anymore. That said it seems like it would be a plausible answer. Thanks.
    – zainogj
    Dec 29, 2015 at 20:37
1

If you are using SFDX, then add the --ignorewarnings parameter (or -g):

sfdx force:mdapi:deploy -d destructiveChangesDir -u test -l RunSpecifiedTests -r SomeTestClass --ignorewarnings --wait -1

It will then not fail the deploy if there is some non-existing metadata listed in your destructiveChanges.xml

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .