# Notification.Scope([NotificationScope]) Method
> Version: _Available or changed with runtime version 1.0._
Specifies the context in which the notification appears in the client.
## Syntax
```al
[Scope := ]  Notification.Scope([Scope: NotificationScope])
```
> NOTE
> This method can be invoked using property access syntax.
## Parameters
Notification
Type: notification-data-type
An instance of the notification-data-type data type.
*[Optional] Scope*
Type: ../notificationscope/notificationscope-option
The scope in which the notification appears in the client
## Return Value
*[Optional] Scope*
Type: ../notificationscope/notificationscope-option
The scope of the current notification.
## Remarks 1
For more information and a detailed example, see ../../devenv-notifications-developing.
##  Example 1
The following code creates a notification and sends it in the local scope.
```al
MyNotification.Message := 'This is a notification';
MyNotification.Scope := NotificationScope::LocalScope;
MyNotification.Send;
```
## Remarks 2
The data that is specified by the SetData method can be retrieved by the GetData Method<../library>. The SetData and GetData methods are typically used for actions with actions on the notification. The SetData method is called from the source is the notification, while the GetData method is called from the action code.
You can use multiple SetData method calls to specify different data items. The data remains available for the life of the notification instance. The data is cleared once the notification instance has been dismissed or an action is taken.
For more information and a detailed example, see ../../devenv-notifications-developing.
##  Example 2
The following code sets the data for a notification:
```al
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:
```al
MyNotification.GetData('Created');
MyNotification.GetData('ID');''
```
## Related information
notification-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>''

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/notification/notification-scope-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/notification/notification-scope-method/
