Auto-Approval in a Multi-Step Salesforce Approval Process
You’ve been tasked with writing an approval process. If an opportunity meets the entry criteria (Stage Name = Pre-Contract) and has an Amount greater than $1000, it needs to be approved by either Bobby or Billy in Sales Management, and if it has an Amount less than or equal to $1000, it needs auto-approval in Salesforce. (We’ll leave the Actions, like field updates, for another discussion.) This article will address how to handle a Multi-Step Salesforce approval process
How can I create an approval process in Salesforce?
That’s easy, you say. (You’re right.) You create an approval process (working in a sandbox, of course) as follows:
- Name: Opportunity Approval
- Entry Criteria: StageName = ‘Pre-Contract’
- Step 1
- Criteria: Amount > 1000, else approve record
- Approvers: Bobby or Billy, whoever responds first
You try it out in the sandbox, and it works great, so you deploy it. Everyone’s happy, right?
Everyone’s happy except Susie in Finance, who wants to review and approve opportunities after Bobby or Billy approve them. So you clone the original approval process (because Salesforce won’t let you add a step to an active approval process), and then change it to this:
- Name: Opportunity Approval
- Entry Criteria: StageName = ‘Pre-Contract’
- Step 1
- Criteria: Amount > 1000, else go to next step
- Approvers: Bobby or Billy, whoever responds first
- Step 2
- Criteria: Amount > 1000, else approve record
- Approvers: Susie
So if the opp meets the entry criteria and is greater than $1000, Bobby or Billy approve it, then it goes to Susie for approval; and if it’s not greater than $1000, it gets auto-approved. Looks good, right?
Nope. This would work if Step 2 actually had the “else approve record” option, but for reasons that surpass understanding, Salesforce doesn’t give you the “else” option for that step. Try as you might, you can’t get Salesforce to add “else approve record” to Step 2. Without a defined “else” option, what actually happens when the approval process runs is not deterministic: it might auto-approve in the sandbox and auto-reject in Production. This can make the multi-step Salesforce approval process a but tricky. (Trust me. I know. I spent a lot of time beating my head against the wall on this one!)
What’s an admin to do?
How do I automate my approval process?
Turns out (of course), there’s a solution. The solution lies in creating two distinct approval processes, both of which are active at the same time.
Process 1:
- Name: Opportunity Auto-Approval
- Entry Criteria: StageName = ‘Pre-Contract’ and Amount <= 1000
- Step 1
- Criteria: false, else auto-approve
- Approvers: doesn’t matter
Process 2:
- Name: Opportunity Approval v2
- Entry Criteria: StageName = ‘Pre-Contract’ and Amount > 1000
- Step 1
- Criteria: true, else go to next step
- Approvers: Bobby or Billy, whoever responds first
- Step 2
- Criteria: true
- Approver: Susie
Really?!? Yes, you can have two active approval processes for the same object at the same time. Salesforce will run all active approval processes for which the opp meets the entry criteria. If the opp doesn’t meet any of the active processes’ entry criteria, you’ll get the usual “Doesn’t meet entry criteria” error.
Elevate your Salesforce chops
Let’s say you have an opp with StageName = Pre-Contract and an Amount of $500. It meets the entry criteria for Process 1, so Process 1 begins. The opp doesn’t meet the criteria for Step 1 (no opp ever will meet that criteria, because it’s false), so it will auto-approve. That’s why it doesn’t matter who you pick as approvers: the opp will never meet the step criteria, so it will never be seen by an approver, so it doesn’t matter who you pick.
That same opp doesn’t meet the entry criteria for Process 2, so that process doesn’t run. There’s no error because the other active process did run.
Now let’s say you have a different opp with StageName = Pre-Contract and an amount of $10,000. It doesn’t meet the criteria for Process 1, so Process 1 doesn’t run. It does meet the criteria for Process 2, so Process 2 sends it first to Bobby or Billy, and if they approve, to Susie. Because the criteria for Step 2 will always be met, you don’t have to worry about the “else” action and the fact that Salesforce doesn’t let you define one.
The lessons learned here? First, if you need to write a multi-step Salesforce approval Process in which auto-approval is an option, you’ll have to create two active approval processes: one for the auto-approval and another for the multiple steps.
Second, you can have multiple active approval processes for the same object. And you can even define the order in which they run.
Third (a little nugget buried above), you can’t add a step to an active approval process. Instead, you have to deactivate the approval process, clone it, and add the step to the clone. (Wondering what happens to any opps that are in the middle of the original approval process? They still follow the original process, even though it’s been deactivated.)
Fourth, although Salesforce’s approval process functionality has some shocking limitations (just try to write an approval process where a lookup field on the opp owner’s User record says who should approve it – you can’t!), there are ways to work around at least some of them. Learn more about how to handle your toughest Salesforce Platform roadblocks with other content on our Learning Center.
If your team is overwhelmed or you’re looking to fast-track your upcoming projects, our team of consultants is here to help. Connect with a member of our team to discuss your project, then access a deep bench of Salesforce consultants to meet your needs. Are you ready to reach for operational excellence?