mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-09 02:41:37 +01:00
Refine events articles after review feedback
Correct wording in five events articles to reflect that AL event subscribers bind by parameter name, not position: - add-new-event-parameters-at-the-end: drop the inaccurate claim that appending a parameter forces subscribers to be updated or causes wrong values; keep the append-at-end best practice. - do-not-add-ishandled-to-an-existing-event: reframe from "breaking change" to the semantic/purpose shift that leaves existing subscribers pointless; rename the breaking-change keyword to semantic-change. - name-events-by-publisher-position: extend the good sample with position-named publishers raised from table and report trigger contexts. - initialize-ishandled-to-false-before-publishing: scope the detection and best practice to events that actually carry a var IsHandled, so an OnBefore with no IsHandled is not flagged. - do-not-bypass-critical-operations-with-ishandled: add a litmus-test definition of a critical operation (code that cannot stand as an independent, self-contained unit). Knowledge-only; no contract or wiring change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
faeacb2484
commit
0ad92cad86
5 changed files with 35 additions and 7 deletions
|
|
@ -33,4 +33,32 @@ codeunit 50255 "Event Naming Good Sample"
|
|||
local procedure OnAfterPostSalesLine(var SalesLine: Record "Sales Line")
|
||||
begin
|
||||
end;
|
||||
|
||||
// Same position-naming convention applies to events raised from table and
|
||||
// report triggers, not just codeunit procedures.
|
||||
|
||||
// Raised at the end of a table field's OnValidate trigger (for example
|
||||
// Customer."No." OnValidate): the position is "after", so OnAfter<Field>.
|
||||
procedure HandleCustomerNoValidated(var Customer: Record Customer)
|
||||
begin
|
||||
OnAfterValidateCustomerNo(Customer);
|
||||
end;
|
||||
|
||||
[IntegrationEvent(false, false)]
|
||||
local procedure OnAfterValidateCustomerNo(var Customer: Record Customer)
|
||||
begin
|
||||
end;
|
||||
|
||||
// Raised before a report prints a line from its processing trigger (for
|
||||
// example a dataitem OnAfterGetRecord): the position is "before", so
|
||||
// OnBefore<Action>.
|
||||
procedure HandleReportLineProcessing(var SalesLine: Record "Sales Line")
|
||||
begin
|
||||
OnBeforeReportPrintLine(SalesLine);
|
||||
end;
|
||||
|
||||
[IntegrationEvent(false, false)]
|
||||
local procedure OnBeforeReportPrintLine(var SalesLine: Record "Sales Line")
|
||||
begin
|
||||
end;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue