bcquality/microsoft/knowledge/data-modeling/custom-document-dispatch-must-not-bypass-report-selections.bad.al
Michael Dieringer 83f041b662 Add 5 AL/BC patterns: document distribution (Report Selections, Document Sending Profile, Find Entries, TransferFields)
Five rules about Business Central's document distribution architecture,
verified against BCApps source and Microsoft Learn.

- custom-document-dispatch-must-not-bypass-report-selections
- document-print-and-email-actions-call-report-selections-directly
- extend-find-entries-navigate-for-new-document-types
- extend-report-selection-usage-for-new-document-types
- transferfields-mirrored-fields-must-match-type-and-length

Wired into al-data-modeling-review.md's worklist cues. Added a
disambiguation note on the TransferFields article distinguishing it from
the existing transferfields-skip-type-mismatch-can-drop-data.md
(type-mismatch skipping vs. length mismatch, which SkipFieldsNotMatchingType
does not affect).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 07:44:17 +02:00

28 lines
866 B
AL

report 50102 "Sample Settlement Doc Bad"
{
UsageCategory = ReportsAndAnalysis;
ApplicationArea = All;
dataset
{
dataitem(Customer; Customer)
{
column(No_Customer; "No.") { }
}
}
}
codeunit 50102 "Sample Settlement Document Send"
{
procedure SendSettlementDocument(var Customer: Record Customer)
begin
Customer.TestField("E-Mail");
// WRONG: hardcoded report, no Report Selections row backing it.
// Works for the default case, but there is nowhere for an admin to
// change the report or layout for one specific customer - this
// document never shows up on "Document Layouts" at all, and the
// only way to change it is a code change and a new release.
Report.RunModal(Report::"Sample Settlement Doc Bad", false, false, Customer);
end;
}