Part 2: The Non-Intrusive Notifications by Business Central
Folayinka Olaofe
Microsoft Dynamics 365 Business Central Developer || Systems Engineer || Tech + Business
So, in the previous article - Part 1: The Non-Intrusive Notifications by Business Central, we looked at how to create custom notifications in Business Central...some pretty cool and simple stuff.
In this article, we are going to take it a step further by embedding actions within the notifications.
Case Study
We will be building on our initial case study i.e. The inventory manager wants to be notified about the number of items with zero inventory each time they open the Item List page. This ensures they can quickly identify and address stockout situations. Now, we have developed and implemented this requirement and the client is happy.... so we thought!
New request from the client:
"We want business central to allow us to generate a report based on the items with zero inventory. It would be fantastic if we can click a single button once the notification pops-up and the report downloads."
Let's Write Some Code!
First off, what does Microsoft have to say about actions embedded in notifications?
This method provides a way for you to create interactive notifications. By default, users have the option to dismiss the notifications. However, there might be cases where you want to provide users with different actions that they can take to address the notification, like opening an associated page for modifying data.
Steps:
领英推荐
Blue Arrow: Points to the part of the "Addaction" method where the name of the action in the front-end will be set.
Yellow Arrow: Points to the part of the "Addaction" method where the codeunit to run can be specified.
Green Arrow: Points to the part of the "Addaction" method where the particular function in the earlier set codeunit can be specified.
Testing Our Code...
When we click on "Print Report", our report is automatically generated:
This brings us to the end of our topic on Notifications in Business Central. Hope you learnt a few new tricks!
Download code from my GitHub: https://github.com/FolaCodedd/Notifications_Business-Central.git
More Sources:
Cheers, Fola
Senior ERP Consultant
1 个月Very nice to have functionality. Well-done Fola. This kind of report will solve the problem of the inventory manager having to make inventory restock plans multiple times.