[Extensibility Request] issue 29074: expose PurchLineQty in OnSumPurchLines2OnBeforeDivideAmount - #9863
Conversation
…PurchLines2OnBeforeDivideAmount event
|
Appending a parameter to this local IntegrationEvent is fine, but the new event parameter is named Suggested fix (apply manually — could not be anchored as a one-click suggestion): local procedure OnSumPurchLines2OnBeforeDivideAmount(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; QtyType: Option General,Invoicing,Shipping; var PurchaseLineQuantity: Decimal)Knowledge:
Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.26.4 |
PredragMaricic
left a comment
There was a problem hiding this comment.
No blocking findings. The by-reference PurchLineQty parameter is exposed at the correct point before DivideAmount and is propagated consistently across all country-layer copies.
Agentic PR Review - Round 1Recommendation: AcceptWhat this PR doesAdds a The value is fully computed at the call site (the case/switch block that assigns Adding a parameter to an already-published event is technically a compile-time break for existing subscribers. However, BCApps policy accepts this pattern for extensibility requests (confirmed by commit 5dbc86e, 409230a, and others merged in the same wave). Partners must update their subscriber signatures on the next major version — this is expected. SuggestionsNone. Risk assessment and necessityRisk: Low for the platform. Existing partner subscribers of this event will get a compile error on the next BC major version and must add the new parameter — this is a known, accepted consequence of in-place event extensions in BCApps. No runtime behavioral change for subscribers that do not modify the new parameter. No performance impact. Necessity: Without this parameter, a subscriber cannot override
|
Summary
4PS Construct implements an "Amounts only" purchasing mode that processes purchase lines by monetary amount rather than physical quantity, which requires adjusting the calculated quantity before the amount-division logic runs. In
SumPurchLines2, theOnSumPurchLines2OnBeforeDivideAmountevent fires right beforeDivideAmountbut does not expose the calculatedPurchLineQty, so subscribers have no way to influence the quantity used for the division. This change addsPurchLineQtyto that event by reference so subscribers can adjust it beforeDivideAmountruns.Source issue repository: microsoft/ALAppExtensions; issue number: 29074
Changes Made
OnSumPurchLines2OnBeforeDivideAmount- added a newvar PurchLineQty: Decimalparameter at the end of the event signature and passed the localPurchLineQtyvariable at the call site inSumPurchLines2, so subscribers can adjust the quantity beforeDivideAmountexecutes. Propagated to the same-named event in every country layer that has its own copy ofPurchPost.Codeunit.al(APAC, BE, CH, ES, FI, GB, IT, NA, RU).Fixes AB#597602