The Dynamics 365 Business Central 2022 Wave 2 version 21.2 update silently introduces a long requested feature: the possibility to schedule job queue tasks via APIs in an integrated session using Service-to-Service (S2S) authentication.
One of the most popular ways of scheduling background processes in Microsoft Dynamics 365 Business Central is by using the Job Queue. In this guide, you will understand how it works and how you can use it. Also, you will learn about error handling along with some general tips.
Today I would like to talk about how to run Job Queue via AL.
A job queue is basically an abstraction that uses the task scheduler from the platform to enable end users to view, create, or modify jobs that are set to run in the background. These jobs can be set to run on a recurring schedule.
In my last blogpost I wrote about how we can implement a Command Queue in AL. In the second part I will go a little bit in detail about the Solution. First of all you have to understand the differenences between valuetypes and referencetypes. If you already know you skip to the next paragraph.
When I was working for the end customer, one of the daily jobs for one of the consultants, was to check if all job queues in all databases and all companies were not stopped by some error.
I thought, why cannot we get the notification whenever the Job Queue is stopped? That would save us a lot of time.
I recently faced an interesting problem. The customer had production terminal at the end of a line, were the operator proceed the output. When he marked the production order as completed he clicked the button on the terminal and the request to post the output was sent to Business Central. For that I created the custom API. Nothing special.