[Extensibility Request] issue 30216: add OnPostItemJnlLineJobConsumptionOnBeforePrepareJobLine event in codeunit 90 Purch.-Post#9446
Conversation
…reJobLine event in codeunit 90 Purch.-Post Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot PR ReviewIteration 1 · 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.6.3. Reply 👎 on any inline comment to flag false positives. |
|
| @@ -1,4 +1,4 @@ | |||
| // ------------------------------------------------------------------------------------------------ | |||
| // ------------------------------------------------------------------------------------------------ | |||
There was a problem hiding this comment.
S2: Please revert this unrelated UTF-8 BOM removal so the IT file changes only for the requested event.
qasimikram
left a comment
There was a problem hiding this comment.
The event is placed at the requested preparation boundary and is propagated consistently across the localized code copies.
S1: Please add regression coverage for the default and handled posting paths, including a subscriber that changes Qty. to Invoice, performs replacement preparation, and completes without duplicate or missing job-posting data.
S2: Revert the unrelated UTF-8 BOM removal in the IT file so this PR remains limited to the event change.
|
@copilot Please revert this unrelated UTF-8 BOM removal so the IT file changes only for the requested event |
929eb83
Done — the UTF-8 BOM has been restored in the IT file. The IT diff now only contains the event additions (commit |
Summary
The reporter needs to intervene during purchase posting immediately before
InvoicePostingInterface.PrepareJobLine(...)runs for job-linked purchase lines. Under specific custom conditions (based on extension fields) they must adjustPurchLine."Qty. to Invoice"and optionally replace the standard job-line preparation with their own implementation. Existing events fire too early or after preparation has already consumed the value, so none allow this. This PR adds anIsHandledintegration event at that exact point so subscribers can modify the quantity and/or skip the standard call.Source issue repository: microsoft/AlAppExtensions; issue number: 30216
Changes Made
OnPostItemJnlLineJobConsumptionOnBeforePrepareJobLine- newIsHandledintegration event raised inPostItemJnlLineJobConsumptionright afterQty. to Invoiceis set and beforeInvoicePostingInterface.PrepareJobLineis called, letting subscribers adjust the quantity or bypass the standard preparation.IsHandledis initialized tofalsebefore the call and the standard call is guarded byif not IsHandled. Applied in the W1 base layer and propagated to the country layers that carry their own copy of the codeunit.Fixes AB#641618