Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Modern notification in Dynamics NAV 2017

Posted on by Microsoft Employee

HI guys,

I am exploring Modern notification in Dynamics NAV 2017. It is working perfectly fine in case of normal pages but it is not working in case of document pages.

I am wondering may be it is due to the "NOTIFICATION SCOPE :: LOCAL", but if this is the case how the item notification on Sales line will come like Inventory is low etc.

Can anyone guide how to implement modern notifications in case of Document pages.

Looking forward

*This post is locked for comments

  • Suggested answer
    Marcellus Profile Picture
    Marcellus 2,735 on at
    RE: Modern notification in Dynamics NAV 2017

    Hi Zohaib,

    I wrote this example for you, it works on the Sales Order page:

    LOCAL [EventSubscriber] ShowWarningAfterNoValidateSalesLine(VAR Rec : Record "Sales Line";VAR xRec : Record "Sales Line";CurrFieldNo : Integer)
    // Event: Subscriber, Event Publisher object: Table Sales Line,
    // Event function: OnAfterValidateEvent,  EventPublisherElement: No. 
    SendNotification(Rec);
    
    LOCAL SendNotification(SalesLine : Record "Sales Line")
    // MyNotification: Notification
    
    IF SalesLine."No." = '' THEN
      EXIT;
    
    WITH MyNotification DO BEGIN
      SCOPE(NOTIFICATIONSCOPE::LocalScope);
      MESSAGE(STRSUBSTNO('You selected %1', SalesLine."No."));
      SETDATA('SalesLineType', FORMAT(SalesLine.Type));
      SETDATA('SalesLineNo', SalesLine."No.");  
      ADDACTION('Show Message', CODEUNIT::"Test", 'ShowMessageAction');
      SEND;
    END;
    
    ShowMessageAction(MyNotification : Notification)
    // Type	Text		
    // No	Text		
    Type := MyNotification.GETDATA('SalesLineType');
    No := MyNotification.GETDATA('SalesLineNo');
    MESSAGE(STRSUBSTNO('%1 - %2', Type, No));


  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Modern notification in Dynamics NAV 2017

    Check codeunit 311 and in that there is a function CreateandSendNotification which handles Item Availability Notification.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans