AL icon indicating copy to clipboard operation
AL copied to clipboard

Add a notification to a RoleCenter?

Open srenders opened this issue 8 years ago • 2 comments

When I run the following code, it does not get executed:

codeunit 70001234 MyCodeunit
{
    trigger OnRun();
    begin
    end;
    
    //[EventSubscriber(ObjectType::Page, page::"O365 Activities", 'OnOpenPageEvent', '', false, false)]
    [EventSubscriber(ObjectType::Page, page::"Business Manager Role Center", 'OnOpenPageEvent', '', false, false)]
    procedure ShowSetupWarningOnBusinessManagerRoleCenter();
    var
        SetupOk : Boolean;
        txtSetupNotReady : TextConst ENU='You need to setup your ....';
        txtSetup : TextConst ENU='Would you like to setup your ...?';
        MyNotification : Notification;
    begin
        SetupOk := false;  //SetupOk := YourSetupTable.GET
        IF NOT SetupOk THEN 
        begin
            MyNotification.MESSAGE(txtSetupNotReady);
            //MyNotification.ADDACTION(txtSetup, CODEUNIT::"... Management", 'Setup...');
            MyNotification.SEND;
        end;    
    end;
}

But when I subscribe to the OnOpenPage of the Activities page, it does get executed. I suppose this is by design, since you can not run code on a RoleCenter, but it would make sense to allow to display a notification on a RoleCenter. What is the best practice here?

srenders avatar May 02 '17 14:05 srenders

This is currently by design but we are discussing how to improve this scenario. The current way to do it is best described in Freddy's blog post: https://blogs.msdn.microsoft.com/freddyk/2017/01/19/the-bingmaps-extension-and-some-tips-and-tricks/ under section 'Display notification that app is not configured on your role center'

StanislawStempin avatar May 03 '17 13:05 StanislawStempin

Ok, thanks.

srenders avatar May 03 '17 14:05 srenders

Hi! Thank you for your suggestion. We are working on focusing the activity in this repository on addressing issues related to the AL development tools.

As this appears to be a great idea, we recommend that you post this on our Ideas forum at aka.ms/BCIdeas, or vote up the idea if it is already there.

We are constantly monitoring top ideas and will consider them for a future release.

SBalslev avatar Dec 21 '23 13:12 SBalslev