Alerts provides cues and lists on a selection of role centres to quickly view unread alerts or failed alerts.

You can add these parts to any other role centre by integrating with Alerts via your own AL extension/app (see Development in AL).

Integrating with Alerts via an extension

  1. Add a dependency to the Alerts app in your AL project. Make sure to use up-to-date values from extension management in Business Central.
  2. Extend the required pages and add the parts in the example below
pageextension 50000 OrderProcessorExt extends "Order Processor Role Center"
{
    layout
    {
        addlast(RoleCenter)
        {
            part(AlertsPart; FSG_ALT_UserAlertPart)
            {
                ApplicationArea = All;
            }
        }
    }
}

pageextension 50001 OrderProcessorActExt extends "SO Processor Activities"
{
    layout
    {
        addlast(content)
        {
            cuegroup(AlertCues)
            {
                Caption = 'Alerts';

                field(UserUnreadAlerts; UserAlertCue.FSG_ALT_UserUnreadAlerts)
                {
                    ApplicationArea = All;
                    Caption = 'My Unread Alerts';
                    StyleExpr = UnreadAlertStyle;
                    ToolTip = 'Specifies the current user''s unread alert entries.';

                    trigger OnDrillDown()
                    var
                        UserAlertEntry: Record FSG_ALT_UserAlertEntry;
                    begin
                        UserAlertEntry.OpenUserUnreadAlerts();
                    end;
                }

                field(FailedAlerts; UserAlertCue.FSG_ALT_FailedAlerts)
                {
                    ApplicationArea = All;
                    Caption = 'Failed Alerts';
                    StyleExpr = UnreadAlertStyle;
                    ToolTip = 'Specifies the failed alert queue entries.';

                    trigger OnDrillDown()
                    var
                        AlertQueueEntry: Record FSG_ALT_AlertQueueEntry;
                    begin
                        AlertQueueEntry.OpenFailedAlerts();
                    end;
                }
            }
        }
    }
    actions
    {
        addlast(Processing)
        {
            action(SetupCues)
            {
                ApplicationArea = Basic, Suite;
                Caption = 'Set Up Alert Cues';
                Image = Setup;
                ToolTip = 'Set up the cues (status tiles) for Alerts.';

                trigger OnAction()
                begin
                    UserAlertCue.OpenCueSetup();
                end;
            }
        }
    }

    var
        UserAlertCue: Record FSG_ALT_UserAlertCue;
        UnreadAlertStyle: Text;
        FailedAlertStyle: Text;


    trigger OnOpenPage();
    begin
        UserAlertCue.InitUserAlertCue();
        UserAlertCue.SetMyUnreadAlertCueStyle(UnreadAlertStyle);
        UserAlertCue.SetFailedAlertCueStyle(FailedAlertStyle);
    end;
}