Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- page 50134 "Notification Test"
- {
- ApplicationArea = All;
- Caption = 'Notification Test';
- PageType = Card;
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field(Message; Message)
- {
- ApplicationArea = All;
- MultiLine = true;
- }
- }
- group(Data)
- {
- field(MyData; MyData)
- {
- ApplicationArea = All;
- Caption = 'My Data';
- }
- }
- }
- }
- actions
- {
- area(Promoted)
- {
- actionref(ShowNotifRef; "Show Notification")
- {
- }
- actionref(HideNotifRef; "Hide Notification")
- {
- }
- }
- area(Processing)
- {
- action("Show Notification")
- {
- ApplicationArea = All;
- Image = Alerts;
- trigger OnAction()
- begin
- Notification.Scope(NotificationScope::LocalScope);
- Notification.Message(Message);
- Notification.SetData('MyData', MyData);
- Notification.AddAction('Do Something', Codeunit::NotificationAction, 'MyAction');
- Notification.Send();
- Notification2.Message(Message + ' + I am copy!');
- Notification2.Send();
- NotifId := Notification2.Id;
- end;
- }
- action("Hide Notification")
- {
- ApplicationArea = All;
- Image = Restore;
- trigger OnAction()
- var
- NotificationL: Notification;
- begin
- NotificationL.Id(NotifId);
- NotificationL.Recall();
- end;
- }
- }
- }
- var
- Message: Text;
- MyData: Text;
- Notification: Notification;
- Notification2: Notification;
- NotifId: Guid;
- }
- codeunit 50140 NotificationAction
- {
- procedure MyAction(MyNotification: Notification)
- begin
- if MyNotification.HasData('MyData') then
- Message(MyNotification.GetData('MyData'));
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement