# TaskScheduler.TaskExists(Guid) Method
> Version: _Available or changed with runtime version 1.0._
Checks whether a specific task exists.
## Syntax
```al
Exists :=   TaskScheduler.TaskExists(Task: Guid)
```
## Parameters
Task
Type: ../guid/guid-data-type
The unique identifier of the task. The unique identifier is returned by the CreateTask method when creating the task.
## Return Value
Exists
Type: ../boolean/boolean-data-type
## Remarks
Scheduled tasks are shown in the Scheduled Tasks page in the client. The TaskScheduler.TaskExists method looks up if the task exists on the page (the implementation is different for the on-premises version compared to the online version of Business Central).
> NOTE
> It's also possible to use ScheduledTask.Get on a record instance of type ScheduledTask to query for existence of a task. This method requires the user to have Read access to the ScheduledTask table, whereas the TaskScheduler.TaskExists method doesn't require the user to have access to the ScheduledTask table.
For more information about the task scheduler, see Using the Task Scheduler<../../devenv-task-scheduler>.
## Example
This example shows how to use TaskScheduler.TaskExists to be able to safely later in the code flow run code that assumes that the task exists.
```al
procedure DoSomethingOnATask(ScheduledTaskId: Guid)
begin
    if not TaskScheduler.TaskExists(ScheduledTaskId) then
    begin
        // handle error
    end;

    // code can now assume that tasks exists

    ...
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-taskexists-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-taskexists-method/
