# TaskScheduler.CanCreateTask() Method
> Version: _Available or changed with runtime version 1.0._
Checks whether it is possible to schedule tasks in this session (depends on the user/app entitlements).
## Syntax
```al
Ok :=   TaskScheduler.CanCreateTask()
```
## Return Value
Ok
Type: ../boolean/boolean-data-type
## Remarks
The TaskScheduler.CanCreateTask checks if tasks are allowed to be created by the user/app of the current session.
For more information about the task scheduler, see Using the Task Scheduler<../../devenv-task-scheduler>.
## Example
This example shows how to use TaskScheduler.CanCreateTask to safely run code that creates tasks.
```al
procedure CreateTask()
begin
    if not CanCreateTask() then
    begin
        // handle the error
    end;

    // code can now assume that tasks can be created

    ...
end;
```
## Related information
taskscheduler-data-type
Using the Task Scheduler<../../devenv-task-scheduler>
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/taskscheduler/taskscheduler-cancreatetask-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/taskscheduler/taskscheduler-cancreatetask-method/
