BusinessEvent Attribute

Version: Available or changed with runtime version 1.0.

Specifies that the method is published as a business type event.

Applies To

  • Method


[BusinessEvent(IncludeSender: Boolean [, Isolated: Boolean])]


 Type: Boolean
Specifies that the firing instance of the object is available as a parameter to subscribers of that event.

[Optional] Isolated
 Type: Boolean
Specifies if event subscribers should be invoked in an isolated transaction.

Snippet support

Typing 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.


For more information about the different event types, see Event Types.

When you set the IncludeSender argument to true, the signature of event subscriber methods that subscribe to the published event automatically include a VAR parameter for the published event object, as shown in the following example:

codeunit 50100 MyPublishingCodeunit
    procedure MyBusinessEvent()

codeunit 50101 MySubscribingCodeunit
    [EventSubscriber(ObjectType::Codeunit, Codeunit::MyPublishingCodeunit, 'MyBusinessEvent', '', true, true)]
    local procedure MySubscriber(sender: Codeunit MyPublishingCodeunit)
        // My subscriber code

For more information about isolated events, see Isolated Events.


This example publishes a business type event by using the OnAddressLineChanged method. The method takes a single text data type parameter. The IncludeSender argument is set to false.

procedure OnAddressLineChanged(line : Text[100]);

See Also

AL Method Reference
Events in AL
Publishing Events
Raising Events
Subscribing to Events
Isolated Events
Method Attributes