In this post we will discuss about how to add new notifications in Dynamics 365 Business Central. Although this is not difficult, it is a very useful feature. Let’s start with Microsoft’s description.
Notifications provide a programmatic way to send non-intrusive information to the User Interface (UI) in the Web client. Notifications differ from messages initiated by the Message method. Messages are modal, which means users are typically required to address the message and take some form of corrective action before they continue working. On the other hand, notifications are non-modal. Their purpose is to give users information about a current situation, but do not require any immediate action or block users from continuing with their current task. For example, you could have a notification that a customer’s credit limit is exceeded.https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-notifications-developing
The notification that a customer’s credit limit is exceeded:
For ease of understanding, I have prepared four examples this time. Hope they will help you.
1. Notification only: Contains only notification information.
2. Adding actions on a notification: Behind the notification, add Action to open other page.
3. Sending data with a notification: Use the SetData and GetData methods to add data to a notification, which is typically needed when actions are invoked.
4. Using External link: User click on Contact Us it will redirect to my blog.
The examples extend page 42 Sales Order:
You can use OnOpenPage() trigger on Sales Order page or subscribe on OnOpenPageEvent of Sales order.
The available method:
|Message||Specifies the content of the notification that appears in the UI.|
|Scope||Specifies the scope in which the notification appears.|
|Send||Sends the notification to be displayed by the client.|
|AddAction||Adds an action on the notification.|
|SetData||Sets a data property value for the notification|
|GetData||Gets a data property value from the notification.|
|Recall||Recalls a sent notification.|
If Posting Date is different from the current date (Today), the Notification will be shown.
Only need a page extension.
Adding actions on a notification
If Posting Date is different from the current date (Today), the Notification will be shown. Then you can choose the Check Work Date action to open the My Settings page.
Notification and Action:
My Settings page:
Sending data with a notification
If the current balance exceeds the credit limit, the new Notification will be shown. Then choose Show details to open the customer ledger entries that is not closed by the current customer.
Notification and Action:
Customer Ledger Entries:
Using External link
In summary, notifications can be created in Business Central to notify the users some important information without blocking actions of the users.
Find out more about Notificationsfrom Microsoft Docs.
Hope this will help.