{"title":"TaskScheduler data type","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/taskscheduler/taskscheduler-data-type/","by":"JOP-AL","license":"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-data-type, 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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/taskscheduler/taskscheduler-data-type","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"TaskScheduler is a complex data type used for creating and managing tasks in the task scheduler, which runs codeunits at scheduled times.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Static methods","slug":"static-methods","at":198,"chars":1219},{"level":2,"title":"Related information","slug":"related-information","at":1417,"chars":170}],"text":"> Version: _Available or changed with runtime version 1.0._\nTaskScheduler is a complex data type used for creating and managing tasks in the task scheduler, which runs codeunits at scheduled times.\n## Static methods\nThe following methods are available on the TaskScheduler data type.\nMethod name|Description\nCancelTask(Guid)<taskscheduler-canceltask-method>|Cancels and deletes a scheduled task that runs a specific codeunit.\ntaskscheduler-cancreatetask-method|Checks whether it is possible to schedule tasks in this session (depends on the user/app entitlements).\nCreateTask(Integer, Integer [, Boolean] [, Text] [, DateTime] [, RecordId])<taskscheduler-createtask-integer-integer-boolean-string-datetime-recordid-method>|Adds a task to be run by the task scheduler. The task is ensured to not run before the specified time.\nCreateTask(Integer, Integer, Boolean, Text, DateTime, RecordId, Duration)<taskscheduler-createtask-integer-integer-boolean-string-datetime-recordid-duration-method>|Adds a task to be run by the task scheduler. The task is ensured to not run before the specified time. This method also allows you to set a timeout for the task.\nSetTaskReady(Guid [, DateTime])<taskscheduler-settaskready-method>|Sets a task that runs a codeunit to the ready state. The task will not run unless it is in the ready state.\nTaskExists(Guid)<taskscheduler-taskexists-method>|Checks whether a specific task exists.\n## Related information\nTask Scheduler Overview<../../devenv-task-scheduler>\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}