{"title":"Notification.GetData(Text) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/notification/notification-getdata-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-getdata-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-getdata-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":"Retrieves data that was passed to a notification instance as specified by a SETDATA method call.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Notification.GetData(Text) Method","slug":"notificationgetdatatext-method","at":0,"chars":1703},{"level":2,"title":"Syntax","slug":"syntax","at":193,"chars":64},{"level":2,"title":"Parameters","slug":"parameters","at":257,"chars":215},{"level":2,"title":"Return Value","slug":"return-value","at":472,"chars":70},{"level":2,"title":"Remarks","slug":"remarks","at":542,"chars":418},{"level":2,"title":" Example","slug":"example","at":960,"chars":603},{"level":2,"title":"Related information","slug":"related-information","at":1563,"chars":140}],"text":"# Notification.GetData(Text) Method\n> Version: _Available or changed with runtime version 1.0._\nRetrieves data that was passed to a notification instance as specified by a SETDATA method call.\n## Syntax\n```al\nValue :=   Notification.GetData(Name: Text)\n```\n## Parameters\nNotification\nType: notification-data-type\nAn instance of the notification-data-type data type.\nName\nType: ../text/text-data-type\nThe name of the data item that is specified by the SETDATA method call.\n## Return Value\nValue\nType: ../text/text-data-type\nThe data retrieved\n## Remarks\nYou use the notification-setdata-method and GetData methods for transferring data in a notification. The methods are typically needed for handling actions on the notification. The notification-setdata-method method is called from the source of the notification, while the GetData method is called from the action code.\nFor more information and a detailed example, see ../../devenv-notifications-developing.\n##  Example\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>"}