5 AL/BC patterns: document distribution (Report Selections, Document Sending Profile, Find Entries, TransferFields) - #175
Open
Michael Dieringer (MichaelDieringer) wants to merge 1 commit into
Conversation
…ent 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>
Michael Dieringer (MichaelDieringer)
requested a review
from Jesper Schulz-Wedde (JesperSchulz)
as a code owner
September 10, 2026 05:44
Author
|
@microsoft-github-policy-service agree company="CURABIS ApS" |
Jesper Schulz-Wedde (JesperSchulz)
requested changes
Sep 15, 2026
Jesper Schulz-Wedde (JesperSchulz)
left a comment
Contributor
There was a problem hiding this comment.
Requesting changes on 83f041b6624b965c061e05bc36cbdc1926399be2.
The exact-tree validators pass (frontmatter; deterministic 305-article index; 34 fixtures/17 leaves), but these are necessary before the rules are safe to execute:
- Owning-skill reachability is contradictory.
al-data-modeling-reviewstill scopes relevance/not-applicable/outcome to setup/master/key/numbering/block/audit surfaces, and its initial tokens omit all five new signal families. The appended worklist cues therefore do not make document actions, Navigate subscribers, report-selection registration, or posting-cascade extensions deterministically reachable. Extend the entry gate/scope and prove each route. - The Document Sending Profile rule and bad fixture do not match current BCApps semantics. Ordinary
Sales Invoice Header.PrintRecords/EmailRecordsuse statelessDocumentSendingProfile.TrySendToPrinter/TrySendToEMail, not directReport Selections; the article names onlyPurchase Headeras an exception. Conversely, the bad sample callsSendon a blank record.Senddoes not load the customer's assigned profile, so this sample does not make the outcome depend on that profile—it simply has all sending options at their defaultNo. Permit the stateless helpers and load a configured/default customer profile in the actual anti-pattern. - The Report Selection Usage rule is overbroad and incomplete. Requiring both customer and vendor filter subscribers even for a one-sided document is contradicted by current
ReportSelectionHandlerCZZ, which partitions sales usages to the customer page and purchase usages to the vendor page. Also, filter subscribers alone only affect Copy from Report Selection; full Document Layouts display/edit support requires extending the page-facing usage enum and handling its map/validate events, as the cited CZC implementation itself does. Scope to the applicable counterparty and either include those pieces or narrow every claim to the copy action. - Evaluation does not exercise any new rule. The generated data-modeling control still selects
check-blocked-in-referencing-code-not-in-master; all five new good/bad pairs are only existence/ranking inputs. Add deterministic positive/clean coverage that demonstrates the corrected owning-skill routes and semantics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five rules about Business Central's document distribution architecture, verified against BCApps source and Microsoft Learn:
Report Selectionsloses per-account layout overrides and "Document Layouts" discoverability.Report Selectionsdirectly;Document Sending Profileis scoped specifically to the combined Post-and-Send action, not general print/email.page 344 Navigate) requires bothOnAfterFindRecordsandOnBeforeShowRecords; either alone leaves a result row with nothing to open it.Report Selection Usagevalue needs bothReportSelections.InsertRecordand a subscriber to the Customer/Vendor "Document Layouts" filter events, or the per-account override UI never lists the new document type.TransferFieldsposting cascade (e.g.Sales Header→Sales Invoice Header) must match type and length exactly; a length-only mismatch compiles and posts cleanly until a value finally exceeds the shorter definition.Each article cites specific BCApps source (file, procedure, and in most cases line number) and, where applicable, Microsoft Learn. Wired into
al-data-modeling-review.md's worklist cues so all five are reachable in review. Added a disambiguation note on the TransferFields article distinguishing it from the existingtransferfields-skip-type-mismatch-can-drop-data.md— that article coversSkipFieldsNotMatchingTypemasking a type mismatch; this one covers the length dimension, which that parameter does not affect at all.Test plan
🤖 Generated with Claude Code