bcquality/microsoft/knowledge/reporting/currreport-skip-does-not-stop-trigger-code.md
Stefano Demiliani b545b22fb9
Add reporting review guidance and evaluation fixtures (#183)
* knowledge(performance): add job queue reliability guidance

* Address Job Queue review feedback

* Address Job Queue routing review feedback

* Encode job queue conflict in fixtures

* Add reporting review guidance and fixtures

* Fix reporting article reference
2026-09-15 10:38:32 +02:00

1.5 KiB

bc-version domain keywords technologies countries application-area
all
reporting
report
currreport
skip
trigger
onaftergetrecord
control-flow
al
w1
all

CurrReport.Skip omits the record but does not stop trigger code

Description

CurrReport.Skip() omits the current record from the report dataset and continues processing with the next record. It does not terminate the current trigger, and the remaining triggers for the current record still run. Code placed after Skip() can therefore produce side effects for a record that never appears in the output.

Best Practice

When no further code in the current trigger should run for a skipped record, call CurrReport.Skip() and then exit the trigger explicitly. Keep later record triggers safe for skipped records because the report runtime still invokes them.

See sample: currreport-skip-does-not-stop-trigger-code.good.al.

Anti Pattern

Call CurrReport.Skip() and rely on it to bypass subsequent statements or later record triggers. The record is removed from the dataset, but those statements and triggers can still update state, write data, or perform expensive work.

See sample: currreport-skip-does-not-stop-trigger-code.bad.al.

References

Report.Skip() method — https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/methods-auto/report/reportinstance-skip-method