The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
GETDATA Method (Notification)
Retrieves data that was passed to a notification instance as specified by a SETDATA Method call.
Value := GETDATA(Name)
Type: Type: Code or text
The name of the data item that is specified by the SETDATA method call.
You use the SETDATA and GETDATA methods for transferring data in a notification. The methods are typically needed for handling actions on the notification. The SETDATA method is called from the source of the notification, while the GETDATA method is called from the action code.
For more information and a detailed example, see Notifications.
The following code sets the data for a notification:
MyNotification.MESSAGE := 'This is a notification'; MyNotification.SCOPE := NOTIFICATIONSCOPE::LocalScope; MyNotification.SETDATA('Created',FORMAT(CURRENTDATETIME,0,9)); MyNotification.SETDATA('ID',FORMAT(CREATEGUID,0,9)); MyNotification.ADDACTION('Action 1',CODEUNIT::"Action Handler",'RunAction1'); MyNotification.ADDACTION('Action 2',CODEUNIT::"Action Handler",'RunAction2'); MyNotification.SEND;
The following code gets the data for a notification: