Pages

Friday, July 17, 2015

Salesforce: Approval Process - Reminder for Approver

In earlier blog, we discussed who can approve on Approval Process? Once user submit a record for approval, approver will receive email to approve or reject, this email is based on email template in Approval Assignment Email Template, but by leave this email template blank, Salesforce will use 'default' template.

But, the approver may missed that email, so the request never been approved or rejected. User also cannot re-submit for approval, by default Submit for Approval button is removed by system after submit for approval.

To track all pending approval requests, admin can run and schedule a standard report called All Pending Approval Requests report, but this will be additional work for admin to manually follow-up on this. Go to Reports tab - Administrative Reports folder - All Pending Approval Requests report.



Solution: create Workflow with Time-Dependent action for Email Alert.
With Time-Dependent Workflow Actions, we can define multiple email alerts for different timing to send alert to approver prior approval / rejection.

Step by step::
1. On the object, add 3 new custom fields to track the approval process:
a) Submit for Approval Date Time - Date/Time field
b) Submit for Approval - Boolean field (default False)
c) Approved - Boolean field (default False)

2. On Approval Process
At Initial Submission Actions, add 2 new Field Update actions to update:
a) Field update: Submit for Approval Date Time = NOW()
b) Field update: Submit for Approval = True

At Final Rejection Actions and Recall Actions, add 1 new Field Update action to update:
c) Field update: Submit for Approval = False
we can leave Submit for Approval Date Time field, so understand the records has been (or when the last) submitted for approval, but rejected/recalled.

At Final Approval Actions, add 1 new Field Update action to update:
d) Field update: Approved = True

3. Create new Workflow with Time-Dependent action:
a) Rule Criteria: Submit for Approval = True AND Approved = False
b) Add Email Alert actions, depend on how many alerts required, as Time-Dependent Workflow Actions
c) Remember to Activate the Workflow.


Issue: the recipient in email alerts (point 3b above).
The recipient in this case would be the approver. Assume the approver is the record owner's manager.
Looking at available recipient type in email alert, there is no option for Owner's Manager.
Vote for this idea: Use 'Owners' Manager for workflow purposes



Here a few options for the workaround:

1. Create a custom Lookup field to User object, this field will show in Related User in the recipient type. You need to have apex trigger to populate owner's manager to this field, but if you are not the #DeveloperHero, use option (2 and 3) below.

2. Similar with option (1) above, create a custom Lookup field to User object, this field will show in Related User in the recipient type. But, instead of using apex trigger to populate owner's manager, you can use Process Builder with action Update Records.



3. Create a custom Email field, this field will be shown in Email Field in the recipient type. You can populate owner's manager email address by using Field Update action, Formula Value = Owner.Manager.EmailThe Field Update action can be added into Approval Process at Initial Submission Actions.


Limitation: if the original approver (Owner's Manager) re-assign the approval process to someone else as Approver, above workflow for reminder will keep send email alert to the original Approver, which is the Owner's Manager.


ReferenceApproval Process With Reminder after submission




4 comments:

  1. My customer wants to send reminder for 48 hours if approver did not approve nor reject. But if the approver approves or rejects, he must not receive reminder is that possible?

    ReplyDelete
    Replies
    1. I think probably possible with a field to mark if that record has been approved, but I have not try yet.

      Delete
    2. Can use this tool: https://lc169.blogspot.com/2022/05/approval-process-reminders.html

      Delete

Page-level ad