Approval Process Reminders (Without Code)

I published recently open source code for setting approval process reminder alert. The code uses free app - Asynchronous Process Manager / Creator - to schedule its processing. In this post I will show alternative option for setting such alerts, without custom code, but only usage of the app.

Keep in mind:

1.The solution require few setup actions per each approval process

2.It provide less capabilities than the solution in the open source code, but should be enough for most use cases


What setup is needed?

Per each approval that we want to use will need:

  1. Date/time field that indicate how long record is pending for approval
  2. Checkbox formula that indicate if reminder should be send for the record
  3. In the approval process fields update that set/clear the date/time field


For the demo, I added approval process on opportunity therefore I created in opportunity:

-Custom date/time field: Approval Start Time

-Formula checkbox: Approval Send Reminder

        The first part calculate the time passed since the Approval Start Time (in hours) and if it is greater than 48 then the formula will be evaluated to true


In my approval process I set 2 approval steps and use 2 fields update:

    • Set Approval Start Time to Now
    • Clear Approval Start Time


What is next?

Use the app to configure a process for sending the alerts.

  • Before starting the next steps: go to Setup->Custom Metadata Types. Click Manage next to Module Standard Object Option, click edit next to record Async Template. In the Available Standard Objects add at the end 'ProcessInstance;ProcessInstanceStep;' and click Save. This settings will allow us to access those objects types in the next steps.


1.Go to tab Async Job Template and click New

2.Provide Name, set status to Live and click Save



3.Click the button Set Actions. This process will have 5 steps, so we can click Add Action button*5 and provide the action names + type


Now lets fill the detail for each step:

Step1- find opportunities record based on the new checkbox field. We should retrieve all
opportunities were Approval Send Reminder is true.
Click button Set Action Params next to the first step, select Related Object as Opportunity,
click + icon to add filter and compare the Approval Send Reminder equal to true (checked)
Click button Close

Step 2 - search Process Instance related to the opportunities.
Click button Set Action Params next to the second step. Select the Related Object as Process
Instance, add filter, select the field Target Object Id equal, click the green filter icon,
choose filter by Find Opportunities for Alert and select the Opportunity Id


Step 3 - select the Related Object as Process Instance Step, add filter Process
Instance Id equal, click the green filter icon , select Filter By Find Related Process
Instance and select the field Process Instance Id

Step 4 - we will create Log Message records in order to send an alerts, which is part of
the package functionalities.
Fill the input
Data Source: Action
Action Source: Find Related Process Instance Steps
Object to Insert: Log Message

In the Field Setup section, select the following fields and set their values as follow:



Last step simply update the opportunity Approval Start Time to now, in order to reset the
counter.

Click Save button above the action list.


Now lets schedule the process.
Click button Create Async Job
Potentially- provide email to get summary email when the process complete
Set Time to Run
Check the Is Repeated Option
Repeated Type: Minutes
Repeated Interval: [Minutes per your needs]

Click Next



Video for the configuration of the Async Job Template:



Tip. If you would like to use email template for the alert, just modify the forth step in the
Async Job Template. Instead of setting the fields Subject and Message Email set the following
fields (Email Template Id should be your email template Id):








No comments:

Post a Comment

Retire of Permission on Profiles

If you are working as a Salesforce admin/developer you've probably heard somewhere that Salesforce is planning to make a significant cha...