Skip to content
Arthur van de Vondervoort edited this page Jul 7, 2024 · 1 revision

Event subscriber var keyword mismatch

Ensures that event subscriber methods use 'var' keyword for parameters as defined by event publisher.

Example

codeunit 50100 MyBusinessLogic
{
    [IntegrationEvent(false, false)]
    local procedure OnBeforeMyBusinessLogic(var Customer: Record Customer; var IsHandled: Boolean)
    begin
    end;
}

codeunit 50501 MyEventSubscriber
{
    [EventSubscriber(ObjectType::Codeunit, Codeunit::MyBusinessLogic, OnBeforeMyBusinessLogic, '', false, false)]
    local procedure OnBeforeMyBusinessLogicOnMyBusinessLogic(Customer: Record Customer) // Parameter 'Customer' must use the 'var' keyword if the publisher parameter is 'var'.
    begin
    end;
}
Clone this wiki locally