📣📣📣 UPDATE (April 23, 2024) - I have recently created a toast notification framework that makes creating toast notifications/in-app notifications absolutely painless. Check it out here!
Wouldn't it be nice if next time you logged into Dynamics you were immediately notified of all the important events that happened while you were gone? Leads assigned to you, opportunities your team closed, cases opened? This is all now possible with 'in-app notifications' for Dynamics 365.
Enable the feature within your model driven apps and users will see notifications when they log in, navigate pages or are on a page for more than a minute.
You can register a notification from the front-end, back-end or over the REST API.
For more info/examples check out Microsoft's offical documentation on in-app notifications here.
Let's see it in action:
There isn't much to getting this up and running.
As I mentioned, you can register a notification from the front-end, back-end or over the REST API. We don't need to go over all those scenarios here because you can find examples in Microsoft's official documentation.
I tried to hack a team guid into the owner instead of a user guid and although I got a success response and the row was created in the db I did not receive any notification
Code from the GIF above:
const notificationEtn = {
title: 'Hat trick alert!',
body: '**Nazem Kadri** going full legend tonight',
'ownerid@odata.bind': '/systemusers(5FFB4B00-BDF1-EB11-94EE-000D3A339361)',
icontype: 100000001,
toasttype: 200000000,
data: JSON.stringify({
actions: [{
title: 'View full game log',
data: {
url: '?pagetype=entityrecord&etn=yyz_gamelog&id=5e12e28e-37db-ec11-a7b6-000d3a300df1',
navigationTarget: 'dialog',
},
}],
}),
};
await Xrm.WebApi.createRecord('appnotification', notificationEtn)
.then((result) => {
console.log('notification registered with ID: ' + result.id);
})
.catch((ex) => console.error(`error message: ${ex.message}`));
There is support for different types of notifications - error, information, mentions, fatoastilures, warnings, etc. You can also use an abbreviated markdown within the message title and body.
As you saw in the GIF, there is support for links but also a variety of ways to open them. Dialogs, inline or new windows are all supported.
Update user roles to have the following privileges:
Before you get crazy with the notifications just be aware these notifications are all stored in a table in your database therefore you are paying database storage prices for the data. You can add a ttlinseconds property to the notificationEtn above to force expiry after a certain period of time. The default is 1,209,600 seconds (2 weeks).
Once an individual notification is dismissed (X is clicked) it is removed from the table, however, selecting 'dismiss all' from the notification pane DOES NOT remove rows from the table.
This feature looks amazing. It is going to be a huge value creator and was super easy to set up. Would love to hear your feedback in the comments below!