mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 06:36:55 +01:00
Narrow IsHandled, label-scope, UI-handler, checkpoint, and bulk-operation guidance to evidence-backed false-positive boundaries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
31 lines
1.1 KiB
AL
31 lines
1.1 KiB
AL
// Demonstration-only AL. Not compiled by CI; illustrates the article.
|
|
codeunit 50240 "IsHandled Init Good Sample"
|
|
{
|
|
procedure ApplyDiscounts(var SalesHeader: Record "Sales Header")
|
|
var
|
|
DiscountPct: Decimal;
|
|
IsHandled: Boolean;
|
|
begin
|
|
// A freshly declared local Boolean is false.
|
|
OnBeforeApplyHeaderDiscount(SalesHeader, DiscountPct, IsHandled);
|
|
if IsHandled then
|
|
exit;
|
|
DiscountPct := 5;
|
|
|
|
// Reaching this point proves that IsHandled is still false.
|
|
OnBeforeApplyPaymentDiscount(SalesHeader, DiscountPct, IsHandled);
|
|
if IsHandled then
|
|
exit;
|
|
DiscountPct += 2;
|
|
end;
|
|
|
|
[IntegrationEvent(false, false)]
|
|
local procedure OnBeforeApplyHeaderDiscount(var SalesHeader: Record "Sales Header"; var DiscountPct: Decimal; var IsHandled: Boolean)
|
|
begin
|
|
end;
|
|
|
|
[IntegrationEvent(false, false)]
|
|
local procedure OnBeforeApplyPaymentDiscount(var SalesHeader: Record "Sales Header"; var DiscountPct: Decimal; var IsHandled: Boolean)
|
|
begin
|
|
end;
|
|
}
|