Notification.GetData(Text) Method

Version: Available or changed with runtime version 1.0.

Retrieves data that was passed to a notification instance as specified by a SETDATA method call.

Syntax

Value :=   Notification.GetData(Name: Text)

Parameters

Notification
 Type: Notification
An instance of the Notification data type.

Name
 Type: Text
The name of the data item that is specified by the SETDATA method call.

Return Value

Value
 Type: Text
The data retrieved

Remarks

You use the SetData Method (Notification) and GetData methods for transferring data in a notification. The methods are typically needed for handling actions on the notification. The SetData Method (Notification) 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.

Example

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:

MyNotification.GetData('Created');
MyNotification.GetData('ID');

Notification Data Type
Get Started with AL
Developing Extensions