Search...
onTaskUpdated( )
An event that triggers when a task is updated.
Description
The onTaskUpdated()
event handler runs when a task is updated. The received TaskUpdated
object contains information about the task that was updated.
Note: Backend events don't work when previewing your site.
Syntax
function wixCrmTasks_onTaskUpdated(event: TaskUpdated): void
onTaskUpdated Parameters
NAME
TYPE
DESCRIPTION
event
Optional
TaskUpdated
Information about the task that was updated and metadata for the event.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
An event fired when a task is updated
Copy Code
1// Place this code in the events.js file2// of your site's Backend section.3// Add the file if it doesn't exist.45export function wixCrmTasks_onTaskUpdated(event) {6 const eventId = event.metadata.id;7 const entityId = event.entity._id;8 const title = event.entity.title;9 console.log('Task updated', event);10}1112/* Full event object:13 * {14 * "metadata": {15 * "id": "ad02b9fa-ec28-48b8-b6f5-9921fbecd090",16 * "entityId": "cdc52d55-e3e8-4fb4-8413-f15838e352b1",17 * "eventTime": "2024-01-21T06:51:36.211546569Z",18 * "triggeredByAnonymizeRequest": false19 * },20 * "entity": {21 * "revision": "2",22 * "title": "Update Contact",23 * "description": "Add new label to sontact",24 * "dueDate": "2024-03-15T00:00:00.000Z",25 * "status": "COMPLETED",26 * "source": {27 * "sourceType": "APP",28 * "appId": "151e476a-715e-ec33-db9a-a7ff4d51f70a"29 * },30 * "contact": {31 * "firstName": "Julie",32 * "lastName": "Jones",33 * "email": "julie.jones@example.com",34 * "phone": "+1 516-569-2772",35 * "_id": "719784da-0361-4f86-b4a4-b38409d7bce1"36 * },37 * "_id": "cdc52d55-e3e8-4fb4-8413-f15838e352b1",38 * "_createdDate": "2024-01-18T13:46:18.198Z",39 * "_updatedDate": "2024-01-21T06:51:36.203Z"40 * }41 * }42 */43