Salesforce Certified Platform App Builder – 5 – Business Logic and Process Automation Part 7
- Approval Processes
Okay, a large and very important piece of workflow. Automation has to do with approval processes. And so I want to set up the scenario that we’re going to run through for an approval process. And I’ve already created some of this process in my own salesforce. org so that we can demonstrate it. I created a custom object called Executive Reviews and so shorten that to be known as an Er Review in the related list on an opportunity. And so I’m going to show you how to set up an approval process related to this custom object for Executive Reviews. And this is a similar scenario to one that I had to implement in real life, one of my salesforce contracts that I worked. So I’m going to click Hide feed to shorten this page layout for this opportunity. And this will hide my Chatter feed.
And that just brings up the opportunity details up at the top and hides the chatter feed. And I can show the feed again, but that’s just a quick tip to show you how to hide a chatter feed. But what we’re interested in are these Er forms. If you notice this related list for Er forms, if I click on that here at the bottom, I’ve got an Executive Review Form that I previously created. It just has a fake name that I entered in here, this Executive Review Form. The idea behind it is that it’s a custom object to where executives can review an opportunity and data from the opportunity that has been saved over into the Executive Review Form, and then they can make the decision if they want to pursue this opportunity or not. And so for these Executive Review forms in our scenario, we want to submit this for approval through a standard salesforce approval process.
And so if I click on this Executive Review Form, it brings me to the Review Form detail page. And so I’ve added a custom field here. It’s a checkbox that says Submit for Approval. And so I’ve got an approval process related to this checkbox, and I’ll go into the setup of the approval process so that it begins to make sense as far as how to administer an approval process on the platform. So if I check to submit this executive review form for approval and click save. Okay, so you notice here on the Executive Review Form, I’ve got this Submit for Approval button on this Related list. And this is an Approval History related list. And this appears because I’ve already set up an approval process related to this custom object in your own. You won’t have any of this built unless you’ve done it so manually. And this is a custom object that I’ve created. And then I’ve already created the approval process around this.
I want to show from the front end for end users what this looks like, and then we’ll get on the back end as far as how this is set. So I’m going to click Submit for Approval, and it warns me that once I submit the record for approval, we may not be able to edit the record or recall it from the approval process depending on our settings. I’ll show you those settings here in a moment from the back end, but I’m going to continue by clicking okay. And so now we see an approval history related list here. And this related list shows the status as pending. It’s pending approval. And we have a couple of line items here in step one of this approval process that I’ve set up. I’ve got two approvers in the approval process. I’ve got Jim Doe and myself. Normally in a real world scenario, if I were submitting something for approval, this would go up to my manager or another related user who’s charged with approving these records. Because this is just a sample organization with only two users available, I’m submitting approval in essence to myself. And so since I’m logged in as myself here, I’ve got this Approve or Reject link to where I could either approve or reject this request.
But before I do that, I want to highlight a few things. First of all, this record is indeed locked from editing. And as an admin, I have the ability to unlock a record and make edits. Then as well, I can recall the approval request. For instance, if I, as an end user, saw that I made a mistake or I wanted to add additional information and resubmit it for approval process, I could click Recall Approval Request and I could add a comment and then recall the approval request. So now you see the status is updated as recalled. So then once I’ve made my changes to this record, I could then submit it for approval again. Click okay. You see this in the approval history, you see the recall, and you see the pending for approval now as well. And a few other things are set to happen here behind the scenes that I will show you here in a moment, such as email alerts going out and approval processes.
You usually have email templates that you have to create and then there’s certain emails or task assignments that you can then send out to people so that they know that they have some action they need to take on the platform. Then as well, if there’s additional items in the approval history that aren’t displayed, you can click Go to List and see the entire record here. But for the actionable items, you’ve got to be on this related list where it shows to Approve or reject. And so I’m going to click on this just to show what this looks like. And this Approval or Rejection screen, they can add comments and then either click Approve or Reject or Cancel. I’m going to cancel out of here for now, and we’re going to go into setup and view this approval process. If I click set up and search for approval, you see here under Workflow and Approvals, we have the Approval Processes link clicking that shows me the list of any active approval processes then as well, any inactive ones as well.
And here’s steps related to setting up approval processes. And they recommend that you read the Help topic related to this. Then there’s a helpful checklist that you can go through. And this goes through things that you need to determine before you start building this approval process. You can also create a user hierarchical relationship field that just has to do with setting up a hierarchy for who should approve this approval request. And it may be the User’s manager, or it could be someone else that’s not necessarily the manager or the user submitting the request. You also need to create the email templates that I mentioned earlier. And I’ve done some of those things already in my own here to demo. And then you can create the actual approval process using either the Jumpstart or the Standard Wizard. There’s two different wizards available.
When creating an approval process, you can add the Approval History related list to all page layouts. I showed that earlier. And then you activate the process to deploy it to your users. And so to create a new approval process, you click here and then you can select either the Jump Start Wizard or the Standard Setup Wizard. The Jumpstart Wizard is one that is used for more simple approval processes, and a lot of it is created for you out of the box. The standard set up wizard is for more complex approval processes. And then as well to highlight, you can manage approval processes for different standard or custom objects. And so if we wanted to create an approval process, for instance, for Account records, we could select Account and then the page refreshes to show that there’s no current active or inactive approval processes related to accounts.
So I’m going to go back to Executive Review, let the screen refresh to show the one active approval process, and I’m going to click on this to show you how this is set up. And so this is that wizard that takes you through the steps of creating the approval process. And here’s where I’ve created the process name. And clicking next to the next step, I have the entry criteria for this approval process. So that records for the Executive Reviews Custom Object, they have to have this criteria met in order for the record to be able to be submitted for review. And so there’s a checkbox I’ve created on executive reviews. I’m going to open this in a new tab here’s, this Executive Review.
And if you notice this checkbox here, submit for Approval, that is a checkbox field, the custom field that I created earlier. And so it’s looking to make sure that the users check this box. There may be some reason that you want this box to be checked. In my own real life scenario, we had to have all sorts of fields populated on this form. And so we added a checkbox for submit for approval that would then fire off a lot of validation rules to make sure we had probably about 30 different fields filled in. And if any of those required fields were not filled in, then it would block them from being able to submit for approval by throwing validation rule errors, saying that in order to submit this record for approval, you must have this data filled in. So once they were able to successfully save the record with all the required details, then we enabled a button to appear through a record type change in a field update so that they could then submit the record for approval.
And that’s a much more complex and advanced example, and I don’t want you to worry about that in relation to the exam. You can see that you can add a lot of functionality and complexity around approval processes. And so for this specific scenario though, what the entry criteria is for the approval process is that this checkbox has to be checked. And so for this screen here, this is the formula editor showing that this custom field has to equal true in order for this approval process record to be a valid entry. So now clicking next here’s where you can select a field used for automated approval routing. And so the next automated approval determined by not set this up, but you could use the Approver field of the Opportunity Owner.
You could determine the Standard Manager field on the standard User record. And so if my own user record, if I had Jim Doe specifies my Manager, then my records that I submit for approval would go to him for approval. And then as well, I’ve set record editability properties for this approval process to where only administrators can edit records during the approval process. Or you could set this to be Administrators, or the currently assigned approval can edit records during the approval process. That would be that if a record submitted to an Approver, they could edit and then approve the record rather than just having to resort to rejecting it, they could make necessary edits and then Approve.
So clicking next to step four of this wizard, you select a notification template, and this is the Approval Assignment email template. And this would be an email that would go out to the approval saying that they’ve been assigned an approval process that they need to review a record and either approve or reject it. And so there’s an email template that I previously created, so you would select the email template to send a notification to the Approvers. Clicking next, you select the fields to display on the Approval page layout. And these are the fields that actually display on this particular screen. Like when I showed earlier the approve or reject. These fields are all of these, the er name created by due date, last modified, the comments, et cetera.
So these are the fields that are showing here and that’s where you set what fields show or not really the only thing that you can do on an approval process as an Approvers inner comments. It’s really limited as far as being able to modify this page layout. And then as well, this isn’t the greatest experience for a user either. I’ve had instances where Approvers have accidentally clicked Reject and it’s kind of difficult to recall that or change that. And so really it’s a training issue then that you want to encourage your approvers to really pay attention to what button they’re clicking when they’re approving or rejecting a record and approval process. And then as well, here’s where we display the approval history information in addition to the field selected above. And so this would be the Approval history related lists here. If I uncheck this checkbox, then the related list for the approval history would not display on that approval screen. Then for security settings, you can allow Approvers to access the approval page only from within the Salesforce application, which is recommended, or you can allow them to access it through a wirelessly enabled mobile device, which is not recommended.
So clicking next, so then the initial submitters. And so there’s different things you can do as far as the people that can initially submit a record for an approval process. And so there’s different types of submitters. You could have it be the creator of the record, such as the creator of the Executive Review Form. You could as well have it be the owner of the Opportunity. And in this example, the Opportunity is the parent to the Executive Review, which is the child or a Master Detail relationship. And so you can also have it be a Customer Portal user and you can specify specific users, partner users, portal role, portal role and subordinates, public groups, roles, roles and internal subordinates or roles and all subordinates or specific users. And so there’s a lot of granularity here as far as who can be an initial submitter into an approval process.
So I want to leave this as the Opportunity owner or the record creator can submit through this approval process. And then as well the submission settings you can allow submitters to recall the approval request. I showed earlier how I’m going to cancel out of this and go back to this button here, recall Approval request that appears because I’ve allowed submitters to recall approval requests. So I’m going to save my changes here. And the only thing I changed was adding an additional allowed submitter. A few things to highlight on this approval process detail page is there’s a lot of information here around the process definition details. You can edit specific things related to this for the name and description or the entry criteria, all these different steps in the wizard you can go right to one of those six steps and edit. For instance, if I wanted to change the approval page layout, I could just click on that and go right there when I cancel that.
And so then you have these other sections here and you’ve got your initial submission actions. And these are initial actions that take place when a record is initially submitted for approval. The things that I’ve set up already are that the record is locked, so it locks the record from being edited once it’s submitted for approval. And then I have an email alert that goes out and this goes out to the same Executive Review approval request to approvers. And so this is an email alert that I’ve set up. You see that the recipients are myself and Jim Doe using this email template. And this is the object that’s related to and you can see that right now that this one approval process is using this email alert. So I’m going to click on that to go back to my previous screen.
You can add additional initial submission actions by clicking Add New and you can do the same four types of actions that you can do for workflow actions as well. It’s the same in an approval process. And this may as well be a question on the exam is what type of actions can you associate or add to an approval process. And those would be tasks, email alerts, field updates, or outbound messages. And you can as well select existing actions or create new ones from here. So if you wanted to assign a task to an approver, you could do that. If you wanted to perform a field update, you could do that as well or outbound message to another system. And that could be where you could send out a message to an approver into some other system even, and not be a salesforce user necessarily. An example from real World that I’ve dealt with with approval processes is upon initial submission we had a filled update to update the stage of the opportunity and then we also had filled updates on the approval steps. And that’s the next section down here.
So if I show the actions here, here’s the actions based on if Jim Doe or Mike Wheeler approve or reject the Executive Review Form. And so one of the actions here is that an email alert goes out and here’s the Executive Review form, approved alert, email template and email alert. And here’s the Executive Review form rejected email alert and associated template. What I was saying earlier is that the field updates that we had around these were that when an Executive Review Form was approved, we would update the stage of the opportunity.
We actually would do a change on the Opportunity record type as well to then change page layouts and hide a few buttons once it had gone through Executive Review so they wouldn’t submit an additional Executive Review form. And then, likewise, if it failed the review and they rejected it, it would update the opportunity associated with the executive review form via a new field update, and it would update the stage to Closed Lost and flip the record Type to Lost Opportunity record type, which would then display additional fields for the reason the opportunity was lost and would automate a field update to say the reason that it was lost was because it was rejected by Executive Review.
And then as well as send out an email alert to the submitter of the form, alerting them that it’s been rejected with further instructions if they wanted to make changes and resubmit for reconsideration. So then as well you can do final approval actions, final rejection actions, and then as well recall actions. So for instance, there’s the unlocking of the record for editing if the record has been recalled, and we showed that earlier when I recalled it, I was able to then make further edits and then resubmit for approval. And so approval processes can be very complex and it’s a very deep subject as well.
And so it’s a good idea to become familiar with the intricacies of approval processes as best you can side of your particular salesforce organization. And if you’ve got the free Developer account with just two users, it may be helpful to create an approval process where there’s just one particular approver and then one.
- Visualizing Approval Processes with the Process Visualizer
I also want to highlight as well this View diagram button. If you click on View diagram, this brings up the process visualizer. And you’ve got your scale here where you can zoom in or out to see more screen real estate. And this shaded area here shows the current area that’s in view. And you can click and drag this to show different area. You can click on these and then see the the particulars on those different pieces of the process. And here’s the entry criteria and it shows the submit for approval equals True. And if it does meet that criteria, then the process starts. You can expand these different areas by clicking the plus sign. And this shows that the record is locked, it sends the email alert for Send Executive Review, Approval, Request to Approvers. And then the different steps here.
And usually you’ll have multiple steps in an approval process. I’ve just created a very basic one and in the real world and in my own experience, I’ve had to create multiple steps related to region. And so if there was approval process on a record that was for the Americas, it would go to one group and then for EMEA it would be another group. And so you may see additional steps related to that. And here’s the Approved and Rejected branches and the different approval and rejection actions. And then as well, there’s a helpful legend to show you what these different icons mean. You can hide the legend by clicking that or show it. You can hide the Navigator or show it as well. You can refresh to see if there’s been any changes to the approval process.
And then you can also create a Printable view by clicking Printable View. And what’s helpful with the Printable view is that you can print an annotated version of the approval process where numbers added to the diagram correspond to details in a table which is included in the Printable view. So if you see here we’ve got these numerical items and then we’ve got a table that displays at the bottom and it gives the approval process properties, the name, whether it’s active editability and other details related to the approval process properties. And if you keep scrolling down, we have the numbered items and it gives the different steps, has the entry criteria. And then item number two are the initial Submission Actions. Item number three is the first step and then the sub steps are for Approvers, Approval Actions and Rejection Actions.
Step number four is the final Approval Actions. Step five is the final rejection actions. Step Six is final recall actions. And so those numbers correspond with the numbers in the Printable view. So this is very helpful for key stakeholders to buy into what you’re building here in the approval process. And this enables you to, like I said, print in an annotated version of the approval process. And those numbers correspond with the table down below and so this may not seem that necessary for a simple or straightforward approval process, but for more complex ones, the numbered items in the table is very helpful to keep track of where you are in the process and the different steps helps you to quickly locate key details. And you can search multi step or complex diagrams for matching text, for instance.
And so with this printable view, you can visualize and understand graphically the steps necessary for a record to be approved, the designated approvers for each step, the criteria used to trigger the approval process, and the specific actions to take when a record is approved, rejected, recalled or first submitted for approval. So keep this in mind, and keep in mind as well, that this particular screen is known as the Process Visualizer. This is not a key term that you’ll run across in the setup menu and it’s not even labeled on this particular screen, but it just may appear on your test and be referred to as the Process Visualizer. And the odds are, if you hadn’t sat through this full lecture, you would run across that question and have no idea what the Process Visualizer was.
- Ownership Automation via Assignment Rules
Another important piece related to business logic and process automation has to do with assignment rules. And so in this lecture we’re going to be talking about assignment rules and then in the next lecture we’ll discuss escalation rules. And so both of these types of rules are core functionality around process automation and you can automate ownership of records through these various rules that are available. So the main thing to keep in mind is we don’t want to confuse the two. And so you see here there’s a lot of different rules and set up and the primary ones have to do with either lead assignment rules or case assignment rules and then in the next lecture with Escalation rules that’s also under service and related to cases. So for now we’re going to focus on lead assignment rules and case assignment rules. And so these are the two objects that support assigning ownership to records based on criteria.
So if I go to the case assignment rules you see that there’s one standard rule active in my organization. You can only have one case assignment rule and then within that when you click on it, you see the different criteria or rule entries. These are set in an evaluation order in a numeric fashion and you should see the same in your own organization. These come standard out of the box with the free developer account and you can adjust these. And so the idea behind these numbers here has to do with the order in which salesforce tries to evaluate these different rules. And then once it finds one that it matches, it will perform the action associated with it. And so this first rule entry has to do with evaluating and determining who to assign a case to.
And so it’s evaluating the account that the case belongs to. And if the billing country contains some derivative of the United States and the service level agreement equals gold or platinum and the account type as a customer, then it will perform these actions here by clicking Edit and you see we can get into more detail around this.
And so the action would be basically what you can do with these assignment rules. And the only action you can do is you can assign this to either a user or a queue. So right now I’ve got this assigned to myself. I could assign this to a different user by performing a search and selecting the user from the search results. I’m going to close out of that though instead of assigning to a different user, I want to assign this to a queue. And so right now I don’t have any queues created. And so you could create a queue which I’m going to do in another tab real quickly. In order to demonstrate this further, I’m just going to call this service queue and make the supported objects a case object. And then for users I’m going to select myself and Jim Doe and click save.
And so Jim Doe and myself are users inside of this queue. And so a queue is helpful for being able to assign ownership not to an individual user, but to a team of users known as a queue. Very helpful. So now if I search for service, we should be able to pull up this queue that I just created. So now I select service queue. And so now whenever this criteria is met for a case, it will automatically assign ownership to the service queue. You can optionally select predefined case teams as well. But the main thing to just keep in mind, as I say, this case assignment rule change is that assignment rules are used to automate the ownership of cases. And then as well, if we search on rules again, we can see lead assignment rules. It’s the same sort of concept in that there’s one standard rule that’s active in your organization when you first create your developer account.
You can go into that and see the role criteria here. There’s just a few. And you can reorder these the same as you can in the case assignment rules. But these are dealing with lead records. And so if I were to reorder these, if I enter two here and I enter one here and click Reorder, I can reorder those lead assignment rules. So you can edit these as well by clicking Edit and then you have your criteria which you can change. And it’s either the criteria is met or you can do a formula evaluating the true. And then as well, you can assign records either to a user or a queue as well. I’m going to cancel out of this though and not change my lead assignment rules.
The lead and case assignment rules are more often found on the admin exam than on the platform app builder or the developer exam. But it’s good to recognize that one of the many ways that you can do workflow automation, especially when it comes to the ownership of records, when it comes to cases and leads, can be found through these assignment rules. And so I’ve narrowed that down by just searching on the word assignment. There’s also a concept known as topic assignment triggers. We’re not going to worry about that on the exam. Another common point of confusion as it relates to rules is that a lot of times it’s easy to confuse assignment rules with escalation rules. And that’s because escalation rules also work on cases. But that has to do with time based behavior. And once a case has not been resolved, things can escalate from there and you can change ownership of a case via escalation rule. So in the next lecture we’re going to look at ownership reassignment and alerts via escalation rule.