Why do you need this change?
At 4PS Construct, we provide an “Amounts only” functionality — a feature that lets users process purchases by monetary amounts rather than physical quantities. Instead of traditional quantity-based lines (e.g., “10 units at $5 each”), the Amounts only mode works directly with amounts (e.g., “$50 worth of services”).
In SumPurchLines2, when Amounts only is enabled, PurchLineQty is calculated differently. However:
- The OnSumPurchLines2OnBeforeDivideAmount event fires before the call to DivideAmount, but PurchLineQty isn’t included in that event’s parameters, so it can’t be adjusted at that point.
- After DivideAmount runs, OnSumPurchLines2OnAfterDivideAmount also doesn’t expose PurchLineQty, so it still can’t be changed.
To correctly implement our functionality, we need a change to the OnSumPurchLines2OnBeforeDivideAmount integration event: the PurchLineQty variable should be included and passed by reference.
Describe the request
Dear ALAppExtensions team,
On behalf of 4PS, I would like to request an update to the integration event OnSumPurchLines2OnBeforeDivideAmount.
Current integration event:
local procedure OnSumPurchLines2OnBeforeDivideAmount(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; QtyType: Option General,Invoicing,Shipping)
Suggested version:
local procedure OnSumPurchLines2OnBeforeDivideAmount(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; QtyType: Option General,Invoicing,Shipping; var PurchLineQty: Decimal)

Internal work item: [AB#597602](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/597602)
Why do you need this change?
At 4PS Construct, we provide an “Amounts only” functionality — a feature that lets users process purchases by monetary amounts rather than physical quantities. Instead of traditional quantity-based lines (e.g., “10 units at $5 each”), the Amounts only mode works directly with amounts (e.g., “$50 worth of services”).
In SumPurchLines2, when Amounts only is enabled, PurchLineQty is calculated differently. However:
To correctly implement our functionality, we need a change to the OnSumPurchLines2OnBeforeDivideAmount integration event: the PurchLineQty variable should be included and passed by reference.
Describe the request
Dear ALAppExtensions team,
On behalf of 4PS, I would like to request an update to the integration event OnSumPurchLines2OnBeforeDivideAmount.
Current integration event:
local procedure OnSumPurchLines2OnBeforeDivideAmount(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; QtyType: Option General,Invoicing,Shipping)
Suggested version:
local procedure OnSumPurchLines2OnBeforeDivideAmount(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; QtyType: Option General,Invoicing,Shipping; var PurchLineQty: Decimal)