Moves a task specified by ID to be placed after another task in the task display.
You can reposition a task to be first in the display by omitting beforeTaskId
.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function moveTaskAfter(
taskId: string,
options: MoveTaskAfterOptions,
): Promise<void>;
ID of the task to move.
Options for moving the task.
This function moves a specified task to be displayed after another task using the moveTaskAfter()
function.
import { tasks } from "wix-crm.v2";
/* Sample taskId value:
* '37c2c378-8085-4ef7-8a3e-6f341248e757'
*
* Sample options value:
* {
* beforeTaskId: '3a49f901-62d5-4ca2-a8e8-395c562a3f7b'
* }
*/
export async function myMoveTaskAfterFunction(taskId, options) {
try {
await tasks.moveTaskAfter(taskId, options);
console.log("Successfuly updated task display.");
} catch (error) {
console.log(error);
// Handle the error
}
}
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.