[Event Request] codeunit 367 "CheckManagement": add OnFinancialVoidCh…#9421
[Event Request] codeunit 367 "CheckManagement": add OnFinancialVoidCh…#9421Explorer986 wants to merge 4 commits into
Conversation
…eckOnBeforePostBalanceAccount IsHandled event; extract balance-account posting into FinancialVoidPostBalanceAccount (AB#640242, ALAppExtensions #30260)
Copilot PR ReviewIteration 4 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@186d8a131465475c79244d994acb872cd5c0d4bf Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 1 knowledge-backed · 0 agent findings. Orchestrator pre-filter (2 file(s) excluded)
Findings produced by the AL review agent v1.7.3. Reply 👎 on any inline comment to flag false positives. |
…eAccount so handled posting flows back for the rounding calc (CI financial-correctness fix)
Agentic PR Review - Round 1Recommendation: Request ChangesWhat this PR doesThis PR adds The event is in the right part of the flow: after the void bank line is posted and before the balance-account entries are posted. The standard path keeps updating SuggestionsS1 - Pass posting context to handled subscribers Risk assessment and necessityRisk: This is core financial void posting in W1, NA, APAC, and RU. The unsubscribed path looks behavior-preserving, including Necessity: The event request is valid because the existing early event forces extensions to replace too much of
|
…t OnFinancialVoidCheckOnBeforeCheckBalAccountType event
| /// </remarks> | ||
| [IntegrationEvent(false, false)] | ||
| local procedure OnFinancialVoidCheckOnBeforeCheckBalAccountType(var GenJournalLine: Record "Gen. Journal Line"; var CheckLedgerEntry: Record "Check Ledger Entry"; var BankAccountLedgerEntry: Record "Bank Account Ledger Entry") | ||
| local procedure OnFinancialVoidCheckOnBeforeCheckBalAccountType(var GenJournalLine: Record "Gen. Journal Line"; var CheckLedgerEntry: Record "Check Ledger Entry"; var BankAccountLedgerEntry: Record "Bank Account Ledger Entry"; var BalanceAmountLCY: Decimal; var IsHandled: Boolean) |
There was a problem hiding this comment.
OnFinancialVoidCheckOnBeforeCheckBalAccountType already shipped without an IsHandled parameter, and this change adds var IsHandled: Boolean directly to it, retrofitting an override seam onto an event that existing subscribers only ever knew as a plain notification.
The caller now wraps the standard Bal. Account Type posting logic in if not IsHandled then, so any subscriber that previously just observed this event can now unintentionally suppress the default posting (G/L, Customer, Vendor) if a future subscriber sets IsHandled without the author realizing the semantics changed. BCQuality guidance is to leave the existing event untouched and add a new dedicated OnBefore event carrying IsHandled instead.
Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
Agentic PR Review - Round 2Recommendation: Request ChangesWhat this PR doesThe new commit removes the separate This addresses only the rounding part of the previous concern. A handled subscriber still does not get the current Status of previous suggestions
New observations (commits since round 1)S2 - Do not add IsHandled to existing event Risk assessment and necessityRisk: This is still core financial void posting in W1, NA, APAC, and RU. The round-2 change also changes a public integration event signature and turns an existing notification event into an override seam. That is a compatibility risk on top of the original posting risk. Necessity: The event request is still valid because extensions need a narrower point to replace balance-account posting. The replacement seam must be safe for posting and safe for existing subscribers. The current shape is not safe enough because it keeps the handled path under-contextualized and changes an existing event instead of adding a dedicated one.
|
What & why
Adds
OnFinancialVoidCheckOnBeforePostBalanceAccount(anIsHandledevent) to codeunit 367 "CheckManagement" so partners can replace the balance-account posting inFinancialVoidCheck— the exact extension point the requester needed but could not get from the too-early existing events. The largecase CheckLedgEntry."Bal. Account Type"block was extracted verbatim into a newFinancialVoidPostBalanceAccountlocal procedure so the guard reads cleanly.Linked work
Fixes AB#640242
How I validated this
What I tested and the outcome
FinancialVoidPostBalanceAccount(withConfirmFinancialVoid.GetVoidType()/GetVoidDate()passed in asVoidType/VoidDateparams); default path (IsHandled := false) calls it, preserving behavior. AL language server reports no errors.Risk & compatibility
Low-medium. Behavior is preserved when unsubscribed, but this is core financial-void posting, so it deserves the regression check above. The new
IsHandledevent lets a subscriber skip the standard bal.-account posting - document if the event is treated as public. No schema/data impact.