BCQuality rule · reportingReporting & Analyticsofficial - Microsoftderived - from the source, no model text

CurrReport.Break ends the current trigger

CurrReport.Break() inside a report dataitem trigger does more than leave an AL loop. It terminates the current trigger and omits the current record from the dataset, so statements after the loop in that trigger do not run.

Rule on GitHub · microsoft layer · reporting · BC all · tier official · derived

Description

CurrReport.Break() inside a report dataitem trigger does more than leave an AL loop. It terminates the current trigger and omits the current record from the dataset, so statements after the loop in that trigger do not run.

In preserved BC 28.4.53241.57274-W1 processing-only OnAfterGetRecord results, it also ended the current dataitem’s iteration: neither the next record nor the broken parent’s children were processed, but OnPostDataItem and OnPostReport still ran. Some distinct record triggers can also run: a reportextension’s OnBeforeAfterGetRecord calling Break() did not suppress the base OnAfterGetRecord or extension OnAfterAfterGetRecord in those results. This does not imply that every child or extension trigger runs.

Best Practice

Use an explicit loop condition or the AL break statement when only the loop must end and the current trigger must continue. Do not use CurrReport.Break() as if it merely skipped one record while preserving later records of that dataitem; in the evidenced context it ends dataitem iteration as well.

Distinguish same-trigger statements from later base/extension triggers and dataitem/report completion. Require the actual trigger relationship and unsafe work before flagging later-trigger side effects. The documented current-trigger/AL-loop distinction is separate from the bounded BC 28.4 observations; do not infer an all-version helper-stack or XmlPort behavior matrix from them.

See sample: currreport-break-ends-the-current-trigger.good.al.

Anti Pattern

Call CurrReport.Break() inside a loop and rely on statements after the loop to finish processing the current record. Those statements are not executed when the call ends the trigger. Conversely, assuming that ending this trigger suppresses all later distinct triggers is also unsafe.

See sample: currreport-break-ends-the-current-trigger.bad.al.

References

Examples

Changed by


From microsoft/BCQuality at aaaf6c1, MIT License, Copyright (c) 2026 Microsoft Corporation (license).