Correct event compatibility guidance

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 645349fd-1892-48f3-8a84-db77d6abd1c3
This commit is contained in:
Jesper Schulz-Wedde 2026-07-14 12:11:38 +02:00
parent 23af51e02d
commit 6c5133fe7e
9 changed files with 54 additions and 47 deletions

View file

@ -1,19 +1,24 @@
// Demonstration-only AL. Version 2 keeps the shipped local event unchanged.
// Demonstration-only AL. Version 1 had CustomerNo and var Score parameters.
codeunit 50520 "Customer Scoring Events"
{
procedure ScoreCustomer(CustomerNo: Code[20]; Score: Integer; Reason: Text)
procedure ScoreCustomer(CustomerNo: Code[20]; Reason: Text; var Score: Integer)
begin
OnCustomerScored(CustomerNo, Score);
OnCustomerScoredV2(CustomerNo, Score, Reason);
OnCustomerScored(CustomerNo, Reason, Score);
end;
// Adding Reason between existing parameters preserves subscriber bindings.
[IntegrationEvent(false, false)]
local procedure OnCustomerScored(CustomerNo: Code[20]; Score: Integer)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnCustomerScoredV2(CustomerNo: Code[20]; Score: Integer; Reason: Text)
local procedure OnCustomerScored(CustomerNo: Code[20]; Reason: Text; var Score: Integer)
begin
end;
}
codeunit 50522 "Existing Scoring Subscriber"
{
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Customer Scoring Events", 'OnCustomerScored', '', false, false)]
local procedure OnCustomerScored(CustomerNo: Code[20]; var Score: Integer)
begin
if CustomerNo = '' then
Score := 0;
end;
}