The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
ID Method (Notification)
Specifies the identifier for a notification.
[CurrID := ] MyNotification.ID
The unique identifier for the notification.
If left unassigned the notification will be assigned an ID when the SEND method is called. For more information, see SEND Method (Notification).
The following code creates a notification and sends it if NewBalance is greater than the credit limit. If it is lower than the credit limit, it recalls the notification.
The example uses a pre-defined ID so that the notification can be recalled.
MyNotification.ID := '00000000-0000-0000-0000-000000000001'; IF NewBallance > Rec. "Credit Limit" THEN BEGIN MyNotification.MESSAGE := 'The customer's current balance exceeds their credit limit.'; MyNotification.SCOPE := NOTIFICATIONSCOPE::LocalScope; MyNotification.ADDACTION('Fix it.', 50001, 'FixCustomerCreditLimit'); MyNotification.SETDATA('CustomerNo.', Rec."No."); MyNotification.SEND; END ELSE MyNotification.RECALL;