Save the day & Create a Task Complete Workflow Email!!!

For years now, I have heard grumbling from other Admins about the functionality of the native Task on the Salesforce Platform.  We have been unable to create Workflow Email on Tasks or Events.  My inability to send an automatic “Task Complete” email to the delegator of said task, has caused my team to give me a less that lackluster enthusiasm for user adoption of Salesforce Activities.  For five years I have heard my colleagues at User Group Meetings and Dreamforce sessions mention this fail in passing as if this was just one of the few downsides that we Kool-aide drinkers are willing to look past.  That is why I am so surprised that there is not an #AwesomeAdmin parade being thrown for these 38 words on page 340 of the Spring16 Release Notes:

Send Email Alerts for Tasks and Events

You can now create email alerts for activities (tasks and events). Once you create an email alert, you can add it to a process, workflow rule, milestone, approval process, or flow.

 

I KNOW!!!! AMAZING RIGHT!!!  I don’t know.  Maybe it wasn’t as big an issue for others as much as I had made it out in my own mind.  Regardless, this was one of the last bricks holding back my company adopting Salesforce Activities in our day-to-day business.  What follows is not an explicit and specific How-To.  I mean it is, but, what I am saying is there are a dozen ways build a TARDIS out of Legos, just as there a dozen ways to use this new feature to your advantage.  What you will find here is simply what I did to create an automated email to notify a delegator that their task has been completed.

First thing I need to declare; all of you should be using your sandboxes and change sets to introduce any new development.  I won’t be discussing any of the details of how to build and deploy a change set, you dig into any of these blogs on the issue.

www.sfdc99.com – How to deploy code from Sandbox to Production

www.adminhero.com – Saving Time With Change Sets

www.arkusinc.com – Salesforce Change Sets for System Administrators

Now, with that out there, I should disclose that I encountered a problem with my first Change Set.  Turns out, we are currently unable to deploy Workflow Email Alerts on Events or Tasks using Change Sets.  I was thoroughly confused by this, but after a brief amount of research I found that Salesforce was already on the case.  There is a Known Issue that states the problem should be fixed by the next release.  YAYYY Salesforce!

Known Issue – Unable to deploy Workflow Email Alerts on Events or Tasks using Change Sets

To send out an email, we need an email template (Setup-Communication Templates – Email Templates.  For reference, this is what the email looks like when a Task is newly assigned to a user.

BlogPic 001 I noticed that we can’t reference the name of the Assigned To from the Task in your email merge.  I opened an idea to fix this.  In the meantime, I created a new Activity Custom Field called AssignedToName.  It is a formula field with the following equation.

Owner:User.FirstName & ” ” & Owner:User.LastName

Note the Idea I submitted once I discovered this issue.

Idea Exchange – Merge the AssignedTo Name

Here is my Email Template.  Feel free to be as creative as you deem suitable in your own email.BlogPic002Now we need a Work Flow Rule.  I named it Task Complete; Keep it Simple.

Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria

Rule Criteria should run this rule if the following formulates to be true.

AND( OwnerId  <>  CreatedById ,    ISPICKVAL(Status, “Completed”))

 All we have left do is to create the Email Alert.  Now if you are doing this in your sandbox, (We are all doing this in our sandboxes, right?) we can’t do much more here.  We can still build this out the rest of the way in the sandbox to test, but make sure the Email task is NOT included in your Change Set.  It will cause the validation to fail.  Once you have everything loaded into a Change Set and deployed into production, write your Email task on the workflow and assign the Email template created earlier.  Make sure it is activated and test it out.

To notify the boss that this new toy is active and ready, I logged in as him, created a task and assigned it to myself.  I logged out and then completed the task with an explanation of the new feature in the Comment section of the Task.  That might be a bit elaborate and unnecessary in some organizations, but what is a life without some levity.  Feel free to tell me what you did or would do different.  Hopefully this small win, can make a rough day into a Nerd-tastic day.