matalino

View Original

Job Queue Failing? Get Notified and Beyond!

I stopped counting how many times I get asked about extending the job queue notifications beyond in-product notifications. Users would like to get notified more than just an email. We get so many emails that it can get lost. Important job queues will require a Teams message on top of an email notification so that it can be actioned against quickly.

Job queue, it is one of the oldest and useful feature within Dynamics Business Central. But there is always a love hate relationship I’ve had with it throughout the years. One primary reason is that when it fails, it isn’t quite noticeable or you will need to be within Business Central to see those notification. As an admin, you’re not always inside Business Central just playing around so in many cases, you will forget!

Well, don’t fret because you can now have it notify you externally via Power Automate, built-in feature! You don’t need to have to figure out how to do it, Microsoft did it for you, you just need to set it up. So let’s get started!

Navigate to the Assisted Setup page and search for “Set Up Job Queue Notifications” and follow the steps.

Set Up Job Queue Notifications - BC

Set Up Job Queue Notifications - BC

During the setup process, you will have two options to turn on for notification:

  1. Set to notify the user who initiated the job queue tasks. This could be helpful if the user is fully responsible in actioning against a failed job queue.

  2. Set to notify the specific administrator that you have listed.

Set Up Job Queue Notifications - BC

On the next step, to utilize external communication, you will need to enable the Business Events as this feature utilizes Microsoft’s Power Automate product, allowing you to send job queue notification externally to other Microsoft products like Teams, Email, etc.

Set Up Job Queue Notifications - BC

Before clicking “Finish”, you will need to click on the hyperlink to create the Power Automate functionality with a template via the Job Queue page.

Note: The set up process we went through only enables In-product notifications and the Business Event it requires for Power Automate to interact.

Set Up Job Queue Notifications - BC

Open one of your job queue entries that you want to enable notification against. From the job queue record page, navigate through actions and create automated flow.

Set Up Job Queue Notifications - BC

Set Up Job Queue Notifications - BC

This will open up a small window to choose an existing template. Now you can create a new flow from scratch but I want to utilize an existing template and extend it. So in this example, I was able to find “Notify in Outlook when Job Queue in Business Central fails.” Follow the steps to enable the flow and you should be good to go!

Note: When utilizing the template, populate the necessary information as I won’t go into details how to do so as it is pretty straight forward. Additionally, give the Flow name as easy as its purpose.

Set Up Job Queue Notifications - BC and Power Automate

Once you set up the Power Automate flow, it will notify you that it is now enabled. If you want to extend it, for example, also sending the information via Teams, you will need to navigate to the flow. You can do so via Power Automate or from the Job Queue > Automate > Manage Flow.

Set Up Job Queue Notifications - BC and Power Automate

Set Up Job Queue Notifications - BC and Power Automate

As you can see from the image, it is fully built from the template. But since we are wanting to also notify us via Teams, we can either ask Copilot to add an action after email or do so manually. In this example, I am going to utilize Copilot to add a new action after email and it did an amazing job! Including the body of the message.

Since I didn’t want to just send it to an individual, I wanted to send it to a channel, I’ve adjusted the action to notify a channel

Set Up Job Queue Notifications - BC and Power Automate

Set Up Job Queue Notifications - BC and Power Automate

Below is an example of the email notification.

Set Up Job Queue Notifications - BC and Power Automate

To finish it off, you will now see that the notification also sends it via Teams!

Set Up Job Queue Notifications - BC and Power Automate