topic hubAL Developmentofficial - Microsoftreviewed - checked by Opus

Running things in the background

Background processing in AL for Business Central: the job queue, page background tasks, and the task scheduler, plus operational limits for background sessions, child sessions and scheduled tasks. It helps answer which mechanism to use, how to set it up, and how errors and limits are handled.

Path: Development > Programming in the AL language > Running things in the background · tier official · system development · narrative reviewed (checked by Opus)

Overview

This section covers the ways AL code can run work outside the user’s foreground session. Three mechanisms are described: the job queue, which lets end users schedule background jobs with recurring options; page background tasks, which run read-only computations for a page without blocking the user; and the task scheduler, which runs codeunits and reports at a specific date and time in a background session.

Start with the Async processing overview, which sets out the operational limits for background sessions, child sessions and scheduled tasks in online and on-premises environments. Then pick the page that matches your scenario: Job queue for user-scheduled and recurring jobs, Page Background Tasks for page responsiveness, and Task scheduler for programmatic scheduling with retry and failure handling. A subtopic holds the AL language reference pages (3 pages) for the related methods and types.

Key points

  • The Async processing overview documents operational limits for background sessions, child sessions and scheduled tasks, online and on-premises.
  • Job queue gives end users a way to schedule background jobs with recurring options. The page covers the job queue flow, dispatcher codeunit, error handler, parameter passing and permissions.
  • Page Background Tasks run read-only computations or long processes asynchronously so pages stay responsive.
  • Page background tasks use parent and child sessions, and take input through dictionary parameters.
  • Page background tasks support timeout configuration, error levels (Ignore, Warning, Error), re-enqueuing and conditional cancellation.
  • Task scheduler runs codeunits and reports at a set date and time in a background session.
  • Task scheduler methods include CreateTask, SetTaskReady, TaskExists and CancelTask.
  • Task scheduler handles retriable exceptions for transient errors and uses failure codeunits when a task fails.

Subtopics

More Learn pages

Videos, posts and code changes

Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 7 Learn pages