cancel
Showing results for 
Search instead for 
Did you mean: 

Create and send notifications

Create and send notifications

To create a notification, you need to define a variable of data type Notification. Some properties and functions that you can use on a variable of data type Notification are:

  • ID - Specifies an identifier for the notification.

  • Message - Specifies the content of the notification that appears in the UI.

  • Scope - Specifies the scope in which the notification appears. You don't have to specify this property because the default is LocalScope.

  • Send - Sends the notification to be displayed by the client.

  • AddAction - Adds an action on the notification. By using the AddAction property, you can run a specific method in another codeunit.

  • SetData - Sets a data property value for the notification.

  • GetData - Gets a data property value from the notification.

  • Recall - Recalls a sent notification.

If you specify an ID, you can recall this notification with the Recall function. Using an ID will also make sure that notifications with the same ID only appear once in the list.

To send a basic notification, you need to provide a message and use the Send function. Be careful with the Message function; you can't use placeholders like you would on a regular Message statement. If you want to use placeholders, you need to use the StrSubstNo function to replace placeholders with their values.

al-languageCopy
 
var 
   MyNotification: Notification;
begin
   MyNotification.Id('2f511c20-b456-4894-8472-4eed76826c65');
   MyNotification.Message('Here comes your notification text.');
   MyNotification.Send();
end;

 ai and machine learning training courses malaysia