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
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));
Check codeunit 311 and in that there is a function CreateandSendNotification which handles Item Availability Notification.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156