Search.../

resetTask( )

Deprecated. This function is deprecated but will continue to work. To reset a task, see the wix-crm.v2.Tasks.updateTask() function.

Description

  • Migration Instructions

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:

  1. Add the new import statement:

    import { tasks } from 'wix-crm.v2'
    javascript | Copy Code
  2. If you plan to migrate all functions that use wixCrmBackend, remove the original import wixCrmBackend statement.

  3. Look for any code that uses wixCrmBackend.tasks.removeTask(), and replace it with with tasks.updateTask(). To reset the task, set the status field to "ACTION_NEEDED".

  4. Test your changes to make sure your code behaves as expected.

Resets a task as not completed.

The resetTask() function returns a Promise that resolves to the ID of the the task after it is reset as not completed.

Syntax

function resetTask(taskId: string): Promise<string>

resetTask Parameters

NAME
TYPE
DESCRIPTION
taskId
string

ID of the task to reset.

Returns

Fulfilled - ID of the task to set as not completed.

Return Type:

Promise<string>

Was this helpful?

Reset a task as not completed

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { tasks } from 'wix-crm-backend';
3
4export const resetTask = webMethod(Permissions.Anyone, (taskId) => {
5 return tasks.resetTask(taskId);
6});
7
8// Returns a promise that resolves to:
9// "3c9683ea-f6cc-470b-b0d1-2eb6b8cea912"