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.)
That’s easy, you say. (You’re right.) You create an approval process (working in a sandbox, of course) as follows:
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:
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. (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?
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.
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.
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 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. If you need help with more than just auto-approval in Salesforce, we can help you with your Salesforce needs.
I hope you approve…
Sign up for weekly OpFocus blog updates!