{"title":"IntegrationEvent attribute","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/attributes/devenv-integrationevent-attribute/","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/attributes/devenv-integrationevent-attribute, 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/attributes/devenv-integrationevent-attribute","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 that the method is published as an integration type event.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":129,"chars":22},{"level":2,"title":"Syntax","slug":"syntax","at":151,"chars":727},{"level":3,"title":"Arguments","slug":"arguments","at":262,"chars":616},{"level":2,"title":"Snippet support","slug":"snippet-support","at":878,"chars":209},{"level":2,"title":"Remarks","slug":"remarks","at":1087,"chars":785},{"level":2,"title":"Example","slug":"example","at":1872,"chars":998},{"level":2,"title":"Related information","slug":"related-information","at":2870,"chars":226}],"text":"> Version: _Available or changed with runtime version 1.0._\nSpecifies that the method is published as an integration type event.\n## Applies to\n Method\n## Syntax\n```al\n[IntegrationEvent(IncludeSender: Boolean, GlobalVarAccess: Boolean [, Isolated: Boolean])]\n```\n### Arguments\nIncludeSender\nType: ../methods-auto/boolean/boolean-data-type\nSpecifies whether global methods in the object that contains the event publisher method are exposed to event subscriber methods that subscribe to the event.\nGlobalVarAccess\nType: ../methods-auto/boolean/boolean-data-type\nSpecifies whether global variables in the object that contains the event publisher method are accessible to event subscriber methods that subscribe to the published event.\n*[Optional] Isolated*\nType: ../methods-auto/boolean/boolean-data-type\nSpecifies if event subscribers should be invoked in an isolated transaction.\n## Snippet support\nTyping the shortcut teventint will create the basic IntegrationEvent attribute syntax when using the AL Language extension for Microsoft Dynamics 365 Business Central in Visual Studio Code.\n## Remarks\nWhen you set IncludeSender to true, an event subscriber can declare a sender parameter that references the publishing object. You must add the parameter to the subscriber manually, as shown in the example.\n> IMPORTANT\n> Avoid GlobalVarAccess. Use event parameters instead, or mark page or table variables as protected. See ../devenv-protected-variables.\nWhen you set GlobalVarAccess to true, an event subscriber can access global variables in the object that declares the publisher method. Add each variable to the subscriber signature manually. Its name and type must match the declaration in the publishing object, as shown in the example.\nLearn more about the different event types in ../devenv-event-types.\nLearn more about isolated events in ../devenv-events-isolated.\n## Example\nThis example publishes an integration type event by using the OnAddressLineChangedEvent method. The method takes one Text parameter.\nThe IncludeSender and GlobalVarAccess arguments are set to true. The subscriber method SubscribeToOnAddressLineChangedEvent therefore includes:\n The sender parameter for event publishing codeunit MyPublishingCodeunit.\n A parameter for the global variable myGlobalVar defined in the publishing codeunit MyPublishingCodeunit.\n```al\ncodeunit 50102 MyPublishingCodeunit\n{\n    [IntegrationEvent(true, true)]\n    procedure OnAddressLineChangedEvent(Line: Text[100])\n    begin\n    end;\n\n    var\n        MyGlobalVar: Integer;\n}\n\ncodeunit 50103 MySubscribingCodeunit\n{\n    [EventSubscriber(ObjectType::Codeunit, Codeunit::MyPublishingCodeunit, 'OnAddressLineChangedEvent', '', true, true)]\n    local procedure SubscribeToOnAddressLineChangedEvent(Sender: Codeunit MyPublishingCodeunit; MyGlobalVar: Integer)\n    begin\n        // My subscriber code\n    end;\n}\n```\n## Related information\nAL method reference<../methods-auto/library>\n../devenv-events-in-al\n../devenv-publishing-events\n../devenv-raising-events\n../devenv-subscribing-to-events\n../devenv-events-isolated\ndevenv-method-attributes"}