Automatically resend approval requests which are still pending

hong_cheung
Kilo Explorer

Hello,

Currently approval requests are emailed to the relevant approvers.   However they sometimes do not respond.   Is there a way to keep resending the email request until a reply has been received?

Many thanks,

Hong

30 REPLIES 30


That's a solid solution if you want to make it more of a "case-by-case" option rather than automate it.



From prior experience with a similar function, my suggestion would be to limit access to that UI Action to a select, trusted group of users and limit the number of times you can invoke the function on a particular record.   You might have that excitable individual who wants their record approved and resends the approval email 20 times.


that is a good point... A condition could be improved by incorporating roles or perhaps a membership... sky's the limit...


If anyone figures this out, I'd like to hear it as well.



I've already stolen Mr Takac's script as a workaround though.  


I tired this and it didn't work, anyone have any ideas of what i did wrong? I have attached the screenshot of the UI Action.


ScreenShot025.jpg


I'll explain how we implemented our solution - maybe it will help...



1. I created a UI action on the sysapproval_approver table that applied to any value where the current.state == 'requested'.   If you want to add other parameters to limit usage (i.e., to certain roles or parent record types) then add that to the condition as well.   Note - in our case, we only made this available as a list choice.



2. I added this code to the script section of the UI action I created.



resendApprovalEmail();



function resendApprovalEmail() {
gs.log("Sending Resend Approval Event");
gs.eventQueue("approval.resend", current, "", "");
gs.addInfoMessage("Resending approval email to: " + current.approver.email);
}



3. I added "approval.resend" to the event registry.



4. I created a new email notification that was basically a duplicate of the one we send approvers today (with a couple of minor modifications) that got sent when the "approval.resend" event was queued up.   Basically, I just copied the "Approval Requested" OOB notification, changed the event type and the template it was calling.



So what our authorized users have now on any record that has an approval associated with it is the ability to go into the approval list, pick the requested approvals they want to send notifications for, and have those emails sent out.



What it took me a bit to figure out was that the best way to approach this was to run the UI action from the Approval table, not the request table.