How to Manage Notifications in Microsoft Dynamics Business Central Wave 2 Release (MSDYN365BC)

I have been writing blogs on the amazing new feature of 2019 Wave 2 release , so this is additional to previous blogs.

Notifications provide a programmatic way to send non-intrusive information to the User Interface (UI) in the Web client.

You can use Notification and NotificationScope data types and methods in AL, Code can be added notify users. The following table provides an overview of the available methods.

MESSAGESpecifies the content of the notification that appears in the UI.
SCOPESpecifies the scope in which the notification appears.
SENDSends the notification to be displayed by the client.
ADDACTIONAdds an action on the notification.
SETDATASets a data property value for the notification
GETDATAGets a data property value from the notification.
RECALLRecalls a sent notification.

So this is basics about Notification in Microsoft Dynamics Business Central Wave 2 Release.

Now lets have a look at the Code aspect in AL.

How to Create Notification in AL

In this example we will Create Message,Scope, Send, AddAction,SetData.

So lets start Creating the Extension.

Open VS Code and Press “Ctrl + Shift + P” to open Command Pallet.

Give Project Name as CreditBalanceNotification and Setup App.json file.Refer to My Blog on How to Connect Dynamics 365 Business Central 2019 Release Wave 2 to Visual Studio Code

Create a New file and Create Page Extension as shown below.

Notification in MSDYN365Bc

As shown in the above Screen shot CreditBalanceNotification is of having Data Type as Notification.

So from this variable we can access all the method which are stated in above table.

As specified in the ADDACTION we have used ActionHandler Codeunit, and below is the code for the same.

Notification in MSDYN365BC

This is simple code where if we get he Customer then it will open the Customer Page.

You can download the code from GitHub.

Now we will test this, if you go to sales order page and check a Sales Order for the Customer whose Balace is greater then Credit Limit then you will get this notification.

You can change the credit Limit by clicking on the link.

To get new updates and learn about Microsoft Dynamics 365 Business Central Microsoft Learn

Thanks for Reading.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s