Deprecated. This function will continue to work, but a newer version is available at wix-crm.v2.Tasks.getTask().
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.getTask()
.
To migrate to the new function:
Add the new import statement:
import { tasks } from "wix-crm.v2";
If you plan to migrate all functions that use wixCrmBackend
,
remove the original import wixCrmBackend
statement.
Look for any code that uses wixCrmBackend.tasks.getTask()
,
and replace it with with tasks.getTask()
.
Update your code to work with the new getTask()
call and response properties.
Test your changes to make sure your code behaves as expected.
Gets a task by ID.
The getTask()
function returns a Promise that resolves to the task with the
given ID.
function getTask(taskId: string): Promise<Task>;
The ID of the task to get from the task list.
import { Permissions, webMethod } from "wix-web-module";
import { tasks } from "wix-crm-backend";
export const getTask = webMethod(Permissions.Anyone, (taskId) => {
return tasks.getTask(taskId);
});
/* Returns a promise that resolves to:
* {
* "_id": "6cb91509-7aa1-479b-a242-7327f58b7157",
* "title": "Add domain",
* "version": 9,
* "dueDate": "2019-01-22T10:00:00Z",
* "contactId": "6cb91509-7aa1-479b-a242-7327f58b7157",
* "isCompleted": false,
* "applicationId: "791f5e4f-5377-47a9-bd8e-cc0ef4605c8f",
* "creatorType": "APP"
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.