{"title":"InternalEvent attribute","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/attributes/devenv-internalevent-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-internalevent-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-internalevent-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 internal event.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":179,"chars":22},{"level":2,"title":"Syntax","slug":"syntax","at":201,"chars":412},{"level":3,"title":"Arguments","slug":"arguments","at":283,"chars":330},{"level":2,"title":"Snippet support","slug":"snippet-support","at":613,"chars":206},{"level":2,"title":"Remarks","slug":"remarks","at":819,"chars":74},{"level":2,"title":"Example","slug":"example","at":893,"chars":437},{"level":2,"title":"Related information","slug":"related-information","at":1330,"chars":226}],"text":"> Version: _Available or changed with runtime version 4.0._\nSpecifies that the method is published as an internal event. It can only be subscribed to from within the same module.\n## Applies to\n Method\n## Syntax\n```al\n[InternalEvent(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 teventinternal will create the basic internal attribute syntax when using the AL Language extension for Microsoft Dynamics 365 Business Central in Visual Studio Code.\n## Remarks\nLearn more about isolated events in ../devenv-events-isolated.\n## Example\nSetting the attribute on a method. Each method must be marked with `[InternalEvent]`.\n```al\ncodeunit 50131 MyInternalCodeunit\n{\n    Access = Internal;\n\n    [InternalEvent(true)]\n    procedure MyEvent()\n    begin\n\n    end;\n}\n\ncodeunit 50132 MySubscriber\n{\n    [EventSubscriber(ObjectType::Codeunit, 50131, 'MyEvent', '', false, false)]\n    procedure MySubscriber(sender: Codeunit MyInternalCodeunit)\n    begin\n\n    end;\n}\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"}