Training
Module
Send notifications in Dynamics 365 Business Central - Training
Discover how to create, send, and enhance user interactions through notifications in this comprehensive guide in Dynamics 365 Business Central.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
A notification badge conveys summary or status information specific to your app. They can be numeric (1-99) or one of a set of system-provided glyphs. Examples of information best conveyed through a badge include network connection status in an online game, user status in a messaging app, number of unread mails in a mail app, and number of new posts in a social media app.
Notification badges appear on your app's taskbar icon and in the lower-right corner of its start tile, regardless of whether the app is running. Badges can be displayed on all tile sizes.
Note
You cannot provide your own badge image; only system-provided badge images can be used.
Value | Badge | XML |
---|---|---|
A number from 1 to 99. A value of 0 is equivalent to the glyph value "none" and will clear the badge. | ![]() |
<badge value="1"/> |
Any number greater than 99. | ![]() |
<badge value="100"/> |
Instead of a number, a badge can display one of a non-extensible set of status glyphs.
Status | Glyph | XML |
---|---|---|
none | (No badge shown.) | <badge value="none"/> |
activity | ![]() |
<badge value="activity"/> |
alarm | ![]() |
<badge value="alarm"/> |
alert | ![]() |
<badge value="alert"/> |
attention | ![]() |
<badge value="attention"/> |
available | ![]() |
<badge value="available"/> |
away | ![]() |
<badge value="away"/> |
busy | ![]() |
<badge value="busy"/> |
error | ![]() |
<badge value="error"/> |
newMessage | ![]() |
<badge value="newMessage"/> |
paused | ![]() |
<badge value="paused"/> |
playing | ![]() |
<badge value="playing"/> |
unavailable | ![]() |
<badge value="unavailable"/> |
These examples show you how to create a badge update.
private void setBadgeNumber(int num)
{
// Get the blank badge XML payload for a badge number
XmlDocument badgeXml =
BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeNumber);
// Set the value of the badge in the XML to our number
XmlElement badgeElement = badgeXml.SelectSingleNode("/badge") as XmlElement;
badgeElement.SetAttribute("value", num.ToString());
// Create the badge notification
BadgeNotification badge = new BadgeNotification(badgeXml);
// Create the badge updater for the application
BadgeUpdater badgeUpdater =
BadgeUpdateManager.CreateBadgeUpdaterForApplication();
// And update the badge
badgeUpdater.Update(badge);
}
private void updateBadgeGlyph()
{
string badgeGlyphValue = "alert";
// Get the blank badge XML payload for a badge glyph
XmlDocument badgeXml =
BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeGlyph);
// Set the value of the badge in the XML to our glyph value
Windows.Data.Xml.Dom.XmlElement badgeElement =
badgeXml.SelectSingleNode("/badge") as Windows.Data.Xml.Dom.XmlElement;
badgeElement.SetAttribute("value", badgeGlyphValue);
// Create the badge notification
BadgeNotification badge = new BadgeNotification(badgeXml);
// Create the badge updater for the application
BadgeUpdater badgeUpdater =
BadgeUpdateManager.CreateBadgeUpdaterForApplication();
// And update the badge
badgeUpdater.Update(badge);
}
private void clearBadge()
{
BadgeUpdateManager.CreateBadgeUpdaterForApplication().Clear();
}
Windows developer feedback
Windows developer is an open source project. Select a link to provide feedback:
Training
Module
Send notifications in Dynamics 365 Business Central - Training
Discover how to create, send, and enhance user interactions through notifications in this comprehensive guide in Dynamics 365 Business Central.