When a task is created, the task is recorded in table 2000000175 Scheduled Task of the database. Here's a general overview of the process: What happens in the exception path depends on whether the exception is retriable. The exception path is used to handle errors and control the retry flow when errors occur in the main path. The main path is used to run the main codeunit and failure codeunits, if any. When a scheduled task is run, there are two possible execution paths that it can follow: the main path and the exception path. This section describes the flow that a scheduled task goes through. The CreateTask method can also specify the earliest date to run the task. Once you have the codeunits, add code to the application that calls the CreateTask method to schedule a task. To set up a task, create codeunits that contain the logic that you want to run at a scheduled time. TaskScheduler.CreateTask(Integer, Integer, Boolean, String, DateTime, RecordId, Duration) Method TaskScheduler.CreateTask(Integer, Integer ) Method MethodĪdds a task to run a codeunit at a specified date and time. In AL code, you create and manage the tasks by using the AL methods that are available for the TASKSCHEDULER data type. This codeunit is referred to as a failure codeunit. Optionally, you can create a second codeunit that contains the logic to handle the task if an error occurs for any reason. Create and manage scheduled tasks in ALĪ scheduled task is basically a codeunit that runs logic in a background session at a specific time. For more information, see Async processing overview. Business Central supports multiple ways to run asynchronous (async) operations, such as job queues, scheduled tasks, new sessions, and page background tasks.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |