Counts the number of tasks.
This method returns the count of all tasks regardless of their status
.
Optionally, you can specify a filter to count only tasks that meet certain criteria.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function countTasks(options: CountTasksOptions): Promise<CountTasksResponse>;
Filtering options.
import { tasks } from "wix-crm.v2";
export async function myCountTasksFunction() {
try {
const count = await tasks.countTasks();
return count;
} catch (error) {
console.log(error);
// Handle the error
}
}
/* Promise resolves to:
* {
* "count": 9
* }
*/
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.