{"title":"Notification.Scope([NotificationScope]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/notification/notification-scope-method/","by":"JOP-AL","license":"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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/notification/notification-scope-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Specifies the context in which the notification appears in the client.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Syntax","slug":"syntax","at":131,"chars":146},{"level":2,"title":"Parameters","slug":"parameters","at":277,"chars":238},{"level":2,"title":"Return Value","slug":"return-value","at":515,"chars":126},{"level":2,"title":"Remarks 1","slug":"remarks-1","at":641,"chars":101},{"level":2,"title":" Example 1","slug":"example-1","at":742,"chars":227},{"level":2,"title":"Remarks 2","slug":"remarks-2","at":969,"chars":660},{"level":2,"title":" Example 2","slug":"example-2","at":1629,"chars":607},{"level":2,"title":"Related information","slug":"related-information","at":2236,"chars":142}],"text":"> Version: _Available or changed with runtime version 1.0._\nSpecifies the context in which the notification appears in the client.\n## Syntax\n```al\n[Scope := ]  Notification.Scope([Scope: NotificationScope])\n```\n> NOTE\n> This method can be invoked using property access syntax.\n## Parameters\nNotification\nType: notification-data-type\nAn instance of the notification-data-type data type.\n*[Optional] Scope*\nType: ../notificationscope/notificationscope-option\nThe scope in which the notification appears in the client\n## Return Value\n*[Optional] Scope*\nType: ../notificationscope/notificationscope-option\nThe scope of the current notification.\n## Remarks 1\nFor more information and a detailed example, see ../../devenv-notifications-developing.\n##  Example 1\nThe following code creates a notification and sends it in the local scope.\n```al\nMyNotification.Message := 'This is a notification';\nMyNotification.Scope := NotificationScope::LocalScope;\nMyNotification.Send;\n```\n## Remarks 2\nThe 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.\nYou 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.\nFor more information and a detailed example, see ../../devenv-notifications-developing.\n##  Example 2\nThe following code sets the data for a notification:\n```al\nMyNotification.Message := 'This is a notification';\nMyNotification.Scope := NotificationScope::LocalScope;\nMyNotification.SetData('Created',Format(CurrentDateTime,0,9));\nMyNotification.SetData('ID',Format(CreateGUID,0,9));\nMyNotification.AddAction('Action 1',CodeUnit::\"Action Handler\",'RunAction1');\nMyNotification.AddAction('Action 2',CodeUnit::\"Action Handler\",'RunAction2');\nMyNotification.Send;\n```\nThe following code gets the data for a notification:\n```al\nMyNotification.GetData('Created');\nMyNotification.GetData('ID');''\n```\n## Related information\nnotification-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>''"}