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.
- microsoftlayer
- reportingdomain
- 2examples
- 2pull requests
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
- Report.Break() remarks and example, pinned source: current-trigger termination, dataset omission, remaining triggers, and the difference from an AL
break. - Documentation PR #5386 deliberately added the remaining-trigger notes to both methods.
- Existing BC 28.4 Windows-container run, artifact
nightly-windows-bc28.4-41034608607: externally supplied third-party-suite results on the Microsoft runtime, not a BCQuality execution or Microsoft-owned test suite. Pinned direct-call assertions and extension-trigger assertions establish the named contexts, not every trigger path or dataset row. - Related Skip clarification; correction provenance: PR #183 comment and issue #200.
Examples
- Good: currreport-break-ends-the-current-trigger.good.al
- Bad: currreport-break-ends-the-current-trigger.bad.al
Changed by
- #255 Correct CurrReport.Skip guidance and retire false fixture expectations, 2026-11-04
- #183 Add reporting review guidance and evaluation fixtures, 2026-09-15
From microsoft/BCQuality at aaaf6c1, MIT License, Copyright (c) 2026 Microsoft Corporation (license).