Deployments of Approval Process with Workflow Field Updates throw error stating that the Workflow Field Update doesn't exist for that SObject.
Last updated 2022-02-10 ·Reference W-1890376 ·Reported By 4 users
Summary
When using the Force.com Migration Toolkit (Ant) to retrieve and deploy an Approval Process, you receive an error similar to the following:
"The approval process references the workflow action FieldUpdate Account.Update_Name_Field, which doesn't exist for the Account object"
where "Account" could be a standard or custom SObject, and "Update_Name_Field" could be the name of a Workflow Field Update.
The issue is caused by a bug in which the Migration Tool is incorrectly adding the SObject name prefix to the <name> of the <action> under <initialSubmissionActions> within the .approvalProcess file. i.e.
<initialSubmissionActions>
<action>
<name>Account.Update_Name_Field</name>
<type>FieldUpdate</type>
</action>
</initialSubmissionActions>
Repro
- Create a package.xml that references an Approval Process and a Workflow Field Update:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Account.Update_Name_Field</members>
<name>WorkflowFieldUpdate</name>
</types>
<types>
<members>Account.ApprovalTest</members>
<name>ApprovalProcess</name>
</types>
<version>28.0</version>
</Package>
- Retrieve the metadata using the above package.xml and the Force.com Migration Toolkit (executed <ant retrieve>)
ACTUAL RESULT:
.approvalProcess file contains:
<initialSubmissionActions>
<action>
<name>Account.Update_Name_Field</name>
<type>FieldUpdate</type>
</action>
</initialSubmissionActions>
EXPECTED RESULT:
.approvalProcess file should contain:
<initialSubmissionActions>
<action>
<name>Update_Name_Field</name>
<type>FieldUpdate</type>
</action>
</initialSubmissionActions>
********
The above-mentioned error will be thrown if you attempt to deploy the .approvalProcess detailed under Actual Results.
Workaround
1) Perform the above action, but remove the SObject name that prefixes the Workflow Field Update name in the .approvalProcess file.
2) Build a second project folder and retrieve Approval Processes and Workflow Field Updates separately. By doing this, the SObject prefix is not included. The .approvalProcess and worfklow metadata files can be combined into one project folder and deployed together.
Reported By (4)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.