Email this post as a PDFDevelopment · 7 October 2026 · 2 min read

Notifications in AL: the blue bar, done right

A notification is the non-blocking message at the top of the page with actions attached. It is the right tool for most of what developers use Message and Error for, and it is misused in both directions. When to use one, how to send it with data and actions, recall it, let users dismiss it permanently, and avoid the three ways it annoys people.

Contents
  1. When
  2. Sending one
  3. IDs and recall
  4. Letting users turn it off
  5. Scope
  6. The three ways it annoys

Between a silent system and a red error dialog there is the notification: the blue bar that says "this customer is over their credit limit" with a button to open the customer, without stopping the user. It is the mildest tool that still gets noticed, and the base application uses it for exactly that reason.

When

Something the user should know and may act on, but which does not prevent what they are doing: a warning, a suggestion, a status, an opportunity ("this item is available in another location"). Not for errors (the operation must not proceed), not for confirmations of success (a Message, or nothing), not for anything that requires an answer before continuing (a Confirm).

Sending one

procedure WarnIfOverCreditLimit(Customer: Record Customer)
var
    Notif: Notification;
begin
    if not Customer.IsOverCreditLimit() then
        exit;
    Notif.Id := CreditLimitNotificationIdTok;        // a fixed GUID, locked label
    Notif.Recall();                                   // replace any existing one with this ID
    Notif.Message := StrSubstNo(OverCreditLimitMsg, Customer."No.", Customer."Credit Limit (LCY)");
    Notif.Scope := NotificationScope::LocalScope;
    Notif.SetData(CustomerNoDataTok, Customer."No.");
    Notif.AddAction(OpenCustomerLbl, Codeunit::"CON Notification Actions", 'OpenCustomer');
    Notif.AddAction(DontShowAgainLbl, Codeunit::"CON Notification Actions", 'DisableCreditLimitNotification');
    Notif.Send();
end;

The action codeunit's procedure receives the notification and reads the data back:

procedure OpenCustomer(Notif: Notification)
var
    Customer: Record Customer;
begin
    if Customer.Get(Notif.GetData(CustomerNoDataTok)) then
        Page.Run(Page::"Customer Card", Customer);
end;

IDs and recall

Give each kind of notification a fixed GUID as its ID. Then Recall() before sending removes the previous instance (so the user does not get five credit-limit bars from five lines), and you can recall it when the condition clears (the user corrected the quantity).

Letting users turn it off

The base application's My Notifications page lists notifications a user can disable. Register yours: subscribe to OnInitializingNotificationWithDefaultState in Codeunit "My Notifications" and call MyNotifications.InsertDefault(Id, Name, Description, Enabled); before sending, check MyNotifications.IsEnabled(Id). Users who know what they are doing switch it off; new starters keep it. Microsoft's guidance is that any notification sent on a routine action should be disableable.

Scope

LocalScope (the page the user is on; the default) covers nearly everything. GlobalScope notifications persist across pages and are for things like "your export is ready"; use them rarely.

The three ways it annoys

  • Sending it on every row of a list (OnAfterGetRecord). Send on the action, or once per page open.
  • No action. A bar that tells you something is wrong with no button to fix it is a worse error dialog.
  • No way to dismiss it permanently. Register with My Notifications.

Used well, one notification replaces a support ticket (the ten) and a training note. The error handling post covers the dialog you use when the operation genuinely has to stop.

Email this post as a PDF
A branded PDF of this post, sent to your inbox to keep, print or share. Copy in colleagues if you like.
We only use these addresses to send this PDF. Nobody is added to a mailing list. Mike at Business Boxed receives a copy. See our privacy notice.
Email this post
Talk to us
Want this done in your Business Central?
Book a 30 minute callGet the monthly newsletter

Related posts