function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mark HansenMark Hansen 

How to trigger on Task overdue?

I'd like to create a Trigger that fires when a Task becomes overdue (i.e., the Due Date is in the past).  Unfortunately, there is now update to the Task record when this happens, so I cannot see how to get a trigger to fire for these overdue tasks.

Is there any way to create a Platform Event or cause some kind of update on a Task when it becomes overdue? I don't want to use batch processing, because that is too CPU intensive (running through all the Task objects) to find the ones that are overdue.
PriyaPriya (Salesforce Developers) 
Hey Mark,

You can create a Time Based Workflow with criteria TaskDueDate - 2 -hours or Days and Status != Completed. In the action send an email alert using the Email template.

Here are the steps for the same 
https://help.salesforce.com/articleView?id=000340084&type=1&mode=1 (https://help.salesforce.com/articleView?id=000340084&type=1&mode=1 (https://help.salesforce.com/articleView?id=000340084&type=1&mode=1))

Also,Kindly refer this link which is similar ask :-

https://developer.salesforce.com/forums/?id=906F00000008w5pIAA
 

Kindly mark it as the best answer if it works for you.

 

Thanks & Regards,

Priya Ranjan


 
Mark HansenMark Hansen
Thanks. Actually I did the same with a Flow (since workflows are being deprecated).  Using a scheduled path to run after the due date.

 Scheduled Path