completeTask( )
Deprecated. This function is deprecated but will continue to work. To set a task as completed, see the wix-crm.v2.Tasks.updateTask() function.
Description
If this function is already in your code, it will continue to work. To stay compatible with future changes, migrate to
wix-crm.v2.Tasks.updateTask()
.To migrate to the new function:
Add the new import statement:
javascript | Copy Codeimport { tasks } from 'wix-crm.v2'If you plan to migrate all functions that use
wixCrmBackend
, remove the originalimport wixCrmBackend
statement.Look for any code that uses
wixCrmBackend.tasks.removeTask()
, and replace it with withtasks.updateTask()
. To set the task as completed, set thestatus
field to"COMPLETED"
.Test your changes to make sure your code behaves as expected.
Sets a task as completed.
The completeTask()
function returns a Promise that resolves to the ID of the
the task after it is set as completed.
Syntax
function completeTask(taskId: string): Promise<string>
completeTask Parameters
NAME
TYPE
DESCRIPTION
ID of the task to set as complete.
Returns
Fulfilled - ID of the task to set as complete.
Return Type:
Was this helpful?
Set a task as completed
1import { Permissions, webMethod } from 'wix-web-module';2import { tasks } from 'wix-crm-backend';34export const completeTask = webMethod(Permissions.Anyone, (taskId) => {5 return tasks.completeTask(taskId);6});78// Returns a promise that resolves to:9// "3c9683ea-f6cc-470b-b0d1-2eb6b8cea912"