Skip to content

Approval process previous approver type

Detection

  • String: Replace PreviousApprover with a valid enumeration value

Examples

  • Error Invoice__c.Invoice_Approval The approver null has an invalid type. Replace PreviousApprover with a valid enumeration value

Resolution

A step of the approval process uses the approver type PreviousApprover, which the Metadata API can not deploy.
- Change the <type> of that approver in the approval process file (queue, user, relatedUserField...)
- Or remove it, deploy, then set the approver in each org after the deployment: the manual deployment action below reminds it

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when post-deploy --type manual --label "Set the previous approver of the approval process" --instructions "1. Open Setup, type Approval Processes in the Quick Find box, and open the approval process
2. Edit the step, and set its approver to the previous approver
3. If it is already set, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/

Comments