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

Ok :=   TaskScheduler.CanCreateTask()

Return Value

Ok
 Type: Boolean

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.

Example

This example shows how to use TaskScheduler.CanCreateTask to safely run code that creates tasks.

procedure CreateTask()
begin
    if not CanCreateTask() then 
    begin
        // handle the error
    end;

    // code can now assume that tasks can be created

    ...
end;

See Also

TaskScheduler Data Type
Using the Task Scheduler
Get Started with AL
Developing Extensions