Search...
updateTaskStatus( )
Developer Preview
Updates completed status of task.
Description
The updateTaskStatus()
function returns a Promise that resolves to the ID of the task whose completed status was updated.
This function is not a universal function and runs only on the backend.
Admin Method
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function updateTaskStatus(_id: string, isCompleted: boolean): Promise<CompleteTaskResponse>
updateTaskStatus Parameters
NAME
TYPE
DESCRIPTION
_id
string
Task ID.
isCompleted
boolean
Indicates whether the task is completed.
Returns
Return Type:
Promise<
CompleteTaskResponse
>NAME
TYPE
DESCRIPTION
_id
string
Task ID.
version
number
The task version. Incremented on each change
Was this helpful?
updateTaskStatus example
Copy Code
1import { tasks } from 'wix-crm.v2';23 async function updateTaskStatus(id, isCompleted) {4 try {5 const result = await tasks.updateTaskStatus(id, isCompleted);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13