In this episode of the ShellBlack Whiteboard, Shell introduces the topic of Workflow Rules. In this first installment of a two-part segment, Shell explains how Workflow can help accelerate your business processes by automating activities like creating tasks, sending emails and updating a record. He also covers what Workflow cannot do – trigger off information in a related list or create a new record. Shell then talks about when Workflow will evaluate a record (the timing) and how you setup the rules (the criteria) that determine if Workflow needs to perform an associated action.
View this video on YouTube: http://youtu.be/00m2b2zxvVs
Other blog posts on this topic:
Transcript of video below:
Hello everyone and welcome to another edition of ShellBlack Whiteboard, and we are going explain another aspect of Salesforce and provide some pro tips and along the way to get the most out of Salesforce platform. I am your host Shell Black, President and founder of ShellBlack.com and Salesforce MVP, and this episode we are going to tackle a big topic and that is Workflow, and we are going to break this into two segments, because it is a big topic.
So, in this segment, we are going to talk about what is Workflow, and what can it do for us, we are going to talk about some of the criteria of what we have to do to make it fire. And then in the second segment we are going to talk about the actions that can either occur real-time, or time-delayed that can fire off if your Workflow kicks off.
So, with that, let’s talk about what is Workflow – what can this do for my organization? So let’s say that we are a salesperson and we have won a deal, we got some things that we have got to do as a result of winning an Opportunity. Maybe I have got to notify my boss, maybe I need to assign a task to sales operations. Maybe I need to send an onboarding welcome email to my customer. If I am winning multiple deals a day, I am spending a lot of time communicating and sending information and assigning tasks to other users. Wouldn’t it be great if all I had to do is win my Opportunity in Salesforce and click save and have the system send out these tasks and emails for me? That is what Workflow can do.
Workflow is essentially an automation engine and it notifies people when they need to get involved. So, maybe you have Legal Counsel, so instead of Legal Counsel having to run a report, to look at the Opportunities by a stage to see if they need to do something, Workflow can bring them in real-time or time-delayed into a business process and pull out some of that lag time between the actions of records being updated in Salesforce.
So, again Workflow is about accelerating you business processes. It is an automation engine, you are going to define when they trigger, and when they do trigger you can do four different things with Workflow. You can create a task. So, either to the owner of the record, or another user, they have to be a user in Salesforce. You can send an email, to an email field in Salesforce like the contact, or an email to someone in the organization that has a Salesforce license. You can do a field update. So, if this field is populated, and this pick list is this populated, maybe you want to update date field with today’s date, something like that, a field update. You can also send an outbound message, and that would be a one-way fire and forget notification to a third party system, so maybe you have an integration or you need to notify someone outside our system outside Salesforce that something occurred. And we will get in more about the particulars about these actions in our next segment. But I just want to highlight what will happen. So, you can fire these actions either real-time or you can delay them so, 30 days out, 180 days out, whatever you want to do. And we will talk about the methods to do this in segment two. You can fire Workflow off of Standard Objects, so your Leads, Accounts, Contacts, or Opportunities, or your Custom Objects. And you can have multiple Workflow rules fire as a result of criteria being met. So, if you win a deal, you can have multiple things happen. This is a feature that is available in Enterprise Edition or higher, and this is one of the big features that a lot of people use to upgrade from Professional Edition to Enterprise Edition to get this business automation.
Let’s see, one thing that Workflow will not do is create a record, at least not today, it won’t create a record. And the last thing to kind of think about when you are thinking about Workflow, everything that you need to evaluate to make sure that it fires with a criteria must be available on the record being saved. So, you can pull in some information from parent records, or if there is a direct lookup off that records you can use formula fields to pull information back to the record, it will not evaluate child records, so if you have records in a related list it is not going to look at your related list and determine that something is need to fire. When you save that record, everything that you need to trigger off of must be on that record.
So let’s get into the criteria, and Salesforce breaks criteria into kind of two buckets. So, you have a bucket called evaluation criteria and that is “when” or the timing. And the things that you can check are when the record is created or saved. And then you have some criteria based on fields and some other logic called “rule criteria”
So let’s go back to evaluation criteria on when it checks the record to see if it needs to do something. There are a couple of instances we have and I am going through these in detail because these are a little confusing. The first option Salesforce gives you is record creation. Very straight forward, only happens once, hit the new button, create my record, hit save, that is when it is going to get evaluated. So, this happens once. This is a fire once type thing, and I will talk about that here in a second. And the second option is created every time it is edited. So this one can actually fire multiple times. So, if I edit a record and I save it in my field logic or whatever I am using for my criteria are true it is going to send my actions that we talked about earlier, my emails, my tasks, my field updates. If I edit the record again, and hit save all those actions are going to happen again. If I hit edit and save again… as long as the criteria is in place this one will fire multiple times if you select this option. So be very careful with that because it can get annoying to the other users, or if you are not using it correctly.
So the third option is if a record is created, and any time it is edited to subsequently meet the criteria, what they are really trying to say is, say this is only going to fire once. So if all the other field criteria in place, the record gets evaluated, it is going to fire once, if you hit edit again, and hit save, it is not going to continue to fire.
So, option one is a fire once, and option two is a fire multiple times, until it doesn’t meet the criteria. Option three is fire once, with the criteria you can continue to edit and save, it is not going to continue to trigger.
Ok.. so this is when the record gets evaluated. Let’s talk about the rule criteria. And Salesforce gives you two options for rule criteria. So, the first one is a little wizard and if you have ever created a view in Salesforce, and I got a tutorial on how to create views in Salesforce. Basically, it is a pull down kind of declarative button click interface, you pick your name of your field, you pick an operator for that field, and an operator would be equals, less than, greater than, contains, starts with, and then the value. So, it could be this day equals “Today,” or this dollar amount is greater than this figure, and you can have multiple fields in this. So, it is a wizard. So, you could say you have ten or so fields being evaluated, and you could also use “and/or” logic. So, if these two values, or if this field is this value, you can trigger it. It is a very simple interface, and it is really easy to get comfortable with that. Sometimes you need to create a formula. Or write a formula for the rule to fire, and a lot times this happens when you want to compare one field against another.
This kind of declarative button click doesn’t let you say if this date is compared to this date. It doesn’t give you that comparison option. If you write a formula, you can use things like a comparison, you can write calculations, so, if these two numbers added together is greater a thousand, maybe that is why it makes it fire. The other thing you can do with a formula is you can kind of check if something has changed on a record. And there are two little formulas that you can use or two operators that you can use. One is called “ISCHANGED” and one is “PRIORVALUE”. So, one checks to see if a value has changed, if a pick list value has changed for example, and prior values checks to see what the prior state of that field was before you hit saved. Those work really well with number two, and that it is the only time you can use one of those changes in states, either PRIORVALUE, or ISCHANGED. Those formulas work with option number two because it will evaluate that. You can’t use that on create, you can’t use that on number three. You can only use that change in state or looking for something changed if you set it to number two.
So, with a combination of these two, when it fire and then the criteria, or when do you want it evaluated criteria to see if it should fire. Then you can have your actions kick off.
So with that, I am going to pause right there and since we have talked about what Workflow is and criteria of what makes a fire and in the next segment we are going to talk about the actions a little bit more in depth. How they trigger real -time or time delayed. If you have any feedback for us you can reach out to us a couple of different ways, you can hit us on email at Whiteboard@ShellBlack.com, or you can hit me on Twitter, Shell_Black, on Twitter I would lover to hear your comments. And check out the next segment on Workflow Actions.