{"title":"BusinessEvent attribute","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/attributes/devenv-businessevent-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-businessevent-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-businessevent-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 a business type event.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":125,"chars":22},{"level":2,"title":"Syntax","slug":"syntax","at":147,"chars":412},{"level":3,"title":"Arguments","slug":"arguments","at":229,"chars":330},{"level":2,"title":"Snippet support","slug":"snippet-support","at":559,"chars":206},{"level":2,"title":"Remarks","slug":"remarks","at":765,"chars":705},{"level":2,"title":"Example","slug":"example","at":1470,"chars":271},{"level":2,"title":"Related information","slug":"related-information","at":1741,"chars":226}],"text":"> Version: _Available or changed with runtime version 1.0._\nSpecifies that the method is published as a business type event.\n## Applies to\n Method\n## Syntax\n```al\n[BusinessEvent(IncludeSender: Boolean [, Isolated: Boolean])]\n```\n### Arguments\nIncludeSender\nType: ../methods-auto/boolean/boolean-data-type\nSpecifies that the firing instance of the object is available as a parameter to subscribers of that 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 teventbus will create the basic BusinessEvent attribute syntax when using the AL Language extension for Microsoft Dynamics 365 Business Central in Visual Studio Code.\n## Remarks\nLearn more about the different event types in ../devenv-event-types.\nWhen you set IncludeSender to true, an event subscriber can declare a sender parameter that references the publishing object, as shown in the following example:\n```al\ncodeunit 50100 MyPublishingCodeunit\n{\n    [BusinessEvent(true)]\n    procedure MyBusinessEvent()\n    begin\n    end;\n}\n\ncodeunit 50101 MySubscribingCodeunit\n{\n    [EventSubscriber(ObjectType::Codeunit, Codeunit::MyPublishingCodeunit, 'MyBusinessEvent', '', true, true)]\n    local procedure MySubscriber(Sender: Codeunit MyPublishingCodeunit)\n    begin\n        // My subscriber code\n    end;\n}\n```\nLearn more about isolated events in ../devenv-events-isolated.\n## Example\nThis example publishes a business type event by using the OnAddressLineChanged method. The method takes one Text parameter. The IncludeSender argument is set to false.\n```al\n[BusinessEvent(false)]\nprocedure OnAddressLineChanged(Line: Text[100])\nbegin\nend;\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"}