Skip to content

Approval process without step

Detection

  • String: An approval process can't be active until it has at least one approval step

Examples

  • Error Invoice__c.Invoice_Approval An approval process can't be active until it has at least one approval step.

Resolution

The approval process is deployed active without any step, often because its steps changed while it was active.
- Deploy it with <active>false</active>, then activate it in each org after the deployment: the manual deployment action below reminds it, with a checkbox in the Pull Request comments
- To change the steps of an active process, clone it into a new process, and deactivate the old one

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 "Activate the approval process" --instructions "1. Open Setup, type Approval Processes in the Quick Find box, and open Approval Processes
2. Select the object, then click Activate next to the approval process of the Pull Request
3. If it is already active, there is nothing to do"

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

Comments