An event that triggers when a task reaches its due date.
The onTaskOverdue()
event handler runs when a task reaches its due date. The received TaskOverdueEvent
object contains information about the task that was updated.
Note: Backend events don't work when previewing your site.
function wixCrmTasks_onTaskOverdue(event: TaskOverdueEvent): void;
Information about the task that's overdue and metadata for the event.
// Place this code in the events.js file
// of your site's Backend section.
// Add the file if it doesn't exist.
export function wixCrmTasks_onTaskOverdue(event) {
const eventId = event.metadata.id;
const entityId = event.entity._id;
const title = event.entity.title;
console.log("Task overdue", event);
}
/* Full event object:
* {
* "metadata": {
* "id": "f772aff2-2c04-4677-968b-2727635ec62c",
* "entityId": "f79fe92b-2482-4884-8cef-53e016506bf7",
* "eventTime": "2024-02-10T10:00:00.000Z",
* "triggeredByAnonymizeRequest": false
* },
* "entity": {
* "revision": "2",
* "title": "Follow up",
* "dueDate": "2024-02-10T10:00:00.000Z",
* "status": "ACTION_NEEDED",
* "source": {
* "sourceType": "USER",
* "userId": "162e6672-d392-42f8-bf79-999ee633c92a"
* },
* "_id": "f79fe92b-2482-4884-8cef-53e016506bf7",
* "_createdDate": "2024-02-13T06:43:44.624Z",
* "_updatedDate": "2024-02-13T06:58:12.896Z"
* }
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.