Imagine you’ve got a record in Salesforce that needs to be approved and double-checked. That’s easy enough to build, just build an approval process with a number of steps and force unanimous approval. But what if you have a business process that involves two steps of approval, and should the record be rejected at the second level, you want it to just go straight back to that next time?
Sarah, the Regional Sales Manager at Unrestricted Receptacles, has seen too many cowboy sales folks sending all sorts of discounts out to customers and it’s having an impact on the win rate. There are a few behaviours she wants to encourage and she also wants to show that she trusts the judgement of her talented sales reps. Sarah is a busy lady; when she approves orders, she only wants to approve them once.
David, a member of our sales team, just wants to sell, but he wants to make sure he’s selling correctly. He likes working at Unrestricted Receptacles.
Jonas just wants to place an order. He has a great relationship with David – he trusts him – and wants David to handle his purchase.
The solution for building this in Salesforce requires the following ingredients:
First things first, let’s take a look at the Order object.
Looks pretty straightforward as far as custom objects go. You’ll see I have a whole section here containing fields that deal with approvals. These are my markers that ensure the record goes down the right approval process.
I also have a nasty formula field called “Current Approval State” there, which is evaluating which stage this record is at in terms of the business process. Helper formula fields are awesome.
For the formula fanatics, here’s the formula for your enjoyment. Yummy.
OK, the next thing to do is to create your fields. I like to put date stamps on things because
Your approval process will be ticking and stamping these boxes as it progresses.
Then, create your approval process. Here’s my sample 2 step process for your enjoyment.
Nice? I’ve got all sorts going on there. The only thing is, my approval process is currently going to fail unless I can get the Sales Manager field populated on my Order record.
It’s got to be a user lookup field that I can get the system to reference. In the olden days, it was a case of getting someone clever to write and cover an Apex trigger to get that field stamped. NOT ANY MORE.
I’ve built a little Flow in Process Builder to set this (and other) fields automatically when an Order is created. It saves the user time; believe me, many users do get princessy about having to fill in lookup fields.
Take a little look at this:
I’m only setting these fields based on record creation; there are no additional criteria, you can just get the job done.
Now that my fields are being set, my approval process can function correctly. Take a look:
Step 1: Route it to the sales manager:
Step 2: Sales Manager approves, off it goes to Finance
Step 3: Finance Rejects
Step 4: Resubmitted straight back to Finance (cutting out the sales manager)
Step 5: Finance are finally happy
When I was diagnosed with Stage 4 in 2021, writing a memoir came to the…
From my point of view I'm acutely aware that I didn't update my readers on…
Service Cloud - KCS & Chatbots Click the buttons below to find the Trailhead modules…
Click the buttons below to find the Trailhead modules we did and follow along with…
Click the buttons below to find the Trailhead modules we did and follow along with…
Click the buttons below to find the Trailhead modules we did and follow along with…