1

I am working with sfdx

Trying to deploy a changed approval process from my sandbox to production

I am getting the approval process with no problems with this command:

sfdx force:source:retrieve -m ApprovalProcess:myCustomObject__c.appProcessName

When I try to deploy with this command:

sfdx deploy -m ApprovalProcess:myCustomObject__c.appProcessName

I always get this error:

The approver null has an invalid type. Replace PreviousApprover with a valid enumeration value.

Of course, the approver in Salesforce UI is filled and have a good and active user in it.

Now when I look into the approval process file, I see that there is a step that it's approver is of type PreviousApprover and without a name:

enter image description here

This is a very strange behaviour - I cannot find this in the Salesforce documentation and when I change the approver for this step in Saleforce UI and then run the sfdx retrieve command, this PreviousApprover does not change.

Other approval processes in my sandbox do not have this PreviousApprover and are deployed successfully.

Also cloning this component also clones the PreviousApprover and have the same problem

My question is:

Can I fix this approval process?

How can I get this component and deploy it without this problem?

1 Answer 1

0

I've been banging my head for hours trying to fix this issue. It's still live as of 2024. I'm pretty sure it's a bug from Salesforce, and it occurs once you try to update the older Approval Processes.

To resolve that, find out this tag:

<type>PreviousApprover</type>

Previous Approver

And see which step of the approval process this is in. From the UI, check in that particular step what the queue/group is. Put that queue/group manually in the XML. This will resolve the issue.

Steps

In here, I updated the first portion to this:

   <approver>
        <type>PreviousApprover</type>
    </approver> **[Removed this portion]**

<approver>
    <name>Maria_Step</name>
    <type>queue</type>
</approver> **[added this portion]**

You must log in to answer this question.

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