> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: deleteTask(taskId: string) # Method package: wixCrmV2 # Method menu location: wixCrmV2 --> tasks --> deleteTask # Method Link: https://dev.wix.com/docs/velo/apis/wix-crm-v2/tasks/delete-task.md # Method Description: Deletes a task by ID. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Delete a task (dashboard page code) ```javascript import { tasks } from 'wix-crm.v2'; /* Sample taskId value: * '3194f3f2-945f-4810-8905-d02b24f9e790' */ export async function myDeleteTaskFunction(taskId) { try { await tasks.deleteTask(taskId); console.log('Task deleted.') } catch (error) { console.log(error); //Handle the error } } ``` ## Delete a task (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { tasks } from 'wix-crm.v2'; import { elevate } from 'wix-auth'; /* Sample taskId value: * '3194f3f2-945f-4810-8905-d02b24f9e790' */ export const myDeleteTaskFunction = webMethod(Permissions.Anyone, async (taskId) => { try { const elevatedDeleteTask = elevate(tasks.deleteTask); await elevatedDeleteTask(taskId); console.log('Task deleted.') } catch (error) { console.log(error); //Handle the error } }); ``` ---