Tuesday, 29 July 2014

Approval Fields in Email Notification

Many of you have been worked with the approval processes. When you are using approval processes, you can define approval notification template. It’s too common when you need to address the approver in email notification who is going to receive this email like:

Hi BSS,

A deal has been submitted and assigned to you for your approval.
Thanks,
<<Assignee Name>>
<<Company Name>>

When you define the email template, you have choice to select the Approval fields.
Request_Approver
Request_Assignee

But unfortunately, none of the field is going to help when you want to include the Approver name in email who is going to handle this approval request.
Request_Approver is, who currently approved this request.
Request_Assignee is, who assigned this request.

I created this email template in Salesforce for testing.

 

Now let’s have a case when you have a multi-step approval process. User requested for the approval and email notification was sent to first level approver. So how will you get the approver name in email?

My approval process is:



I created an account and it sent the Approval Request to Lisa Hayden. Following email was sent to User Lisa.

See both the field says Bhavi Sharma.


How you can quickly fix this:
  1. Create a user lookup field on your object and call it “Next Approver”.
  2. In the approval process’s initial submission action, populate this field with the appropriate user (If you are using a queue, better is to create a Text field and get it populated with the Queue name).
  3. Now use this field in email approval submission notification email.
  4. In the first level approval actions, get this custom field populated with the name of the second level approver.

3 comments:

  1. This sounds good but won't work when one of the steps has multiple approves all at once.

    ReplyDelete
  2. This will work if similar people gonna approve all the request. In my case, each users manager will approve the request and cannot use "Lookup field" as the field update is static.

    ReplyDelete