Codeunit 7010 "Purch. Price Calc. Mgt."
Base Application · Microsoft.Purchases.Pricing
Across versions
- BC23present
- BC24declaration changed
- BC251 procedures added, 1 procedures removed
- BC261 events added, 1 events removed
- BC27unchanged
- BC283 events added, 1 procedures changed
- BC29-30unchanged
Neighbourhood 4 connected objects and pages
Base Application · Microsoft.Purchases.Pricing · BC23-30 · source at ea08af5e · facts from BC29
Events published
OnAfterCalcBestDirectUnitCostFound(var PurchPrice: Record "Purchase Price"; var BestPurchPriceFound: Boolean; var IsHandled: Boolean)(integration)OnAfterCalcBestLineDisc(var PurchaLineDisc: Record "Purchase Line Discount"; var BestPurchLineDisc: Record "Purchase Line Discount")(integration)OnAfterFindJobJnlLinePrice(var JobJournalLine: Record "Job Journal Line"; var IsHandled: Boolean)(integration)OnAfterFindJobPlanningLinePrice(var JobPlanningLine: Record "Job Planning Line"; var ResourceCost: Record "Resource Cost")(integration)OnAfterFindJobJnlLinePriceItem(var JobJournalLine: Record "Job Journal Line")(integration)OnAfterFindJobJnlLinePriceResource(var JobJournalLine: Record "Job Journal Line"; var ResourceCost: Record "Resource Cost")(integration)OnAfterFindPurchPrice(var ToPurchPrice: Record "Purchase Price"; FromPurchasePrice: Record "Purchase Price"; VendorNo: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean; Qty: Decimal; QtyPerUOM: Decimal)(integration)OnAfterFindPurchLinePrice(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var PurchasePrice: Record "Purchase Price"; CalledByFieldNo: Integer; PriceInSKU: Boolean; FoundPurchPrice: Boolean)(integration)OnAfterFindPurchLineDisc(var ToPurchaseLineDiscount: Record "Purchase Line Discount"; var FromPurchaseLineDiscount: Record "Purchase Line Discount"; ItemNo: Code[20]; QuantityPerUoM: Decimal; Quantity: Decimal; ShowAll: Boolean)(integration)OnAfterFindPurchLineLineDisc(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var TempPurchLineDisc: Record "Purchase Line Discount" temporary)(integration)OnAfterFindReqLinePrice(var ReqLine: Record "Requisition Line"; var TempPurchasePrice: Record "Purchase Price" temporary; CalledByFieldNo: Integer)(integration)OnAfterFindReqLineDisc(var ReqLine: Record "Requisition Line")(integration)OnAfterGetPurchLinePrice(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var TempPurchasePrice: Record "Purchase Price" temporary; QtyPerUOM: Decimal)(integration)OnAfterGetPurchLineLineDisc(var PurchaseLine: Record "Purchase Line"; var TempPurchLineDisc: Record "Purchase Line Discount")(integration)OnAfterJobJnlLineFindResCost(var JobJournalLine: Record "Job Journal Line"; CalledByFieldNo: Integer; var ResourceCost: Record "Resource Cost")(integration)OnAfterJobPlanningLineFindResCost(var JobPlanningLine: Record "Job Planning Line"; CalledByFieldNo: Integer; var ResourceCost: Record "Resource Cost")(integration)OnAfterPurchLineLineDiscExists(var PurchaseLine: Record "Purchase Line")(integration)OnAfterPurchLinePriceExists(var PurchaseLine: Record "Purchase Line")(integration)OnAfterSetCurrency(var CurrencyFactor: Decimal; var ExchRateDate: Date; var PricesInCurrency: Boolean; var PricesInclVAT: Boolean; var VATPerCent: Decimal; var VATBusPostingGr: Code[20]; var DateCaption: Text[30]; var PriceInSKU: Boolean; var FoundPurchPrice: Boolean)(integration)OnBeforeCalcBestDirectUnitCost(var PurchPrice: Record "Purchase Price"; var BestPurchPrice: Record "Purchase Price"; var BestPurchPriceFound: Boolean; var IsHandled: Boolean; var StockkeepingUnit: Record "Stockkeeping Unit"; var Item: Record Item)+ BC26 − BC26 (integration)OnBeforeCalcBestLineDisc(var PurchLineDisc: Record "Purchase Line Discount"; Item: Record Item; var IsHandled: Boolean; QtyPerUOM: Decimal; Qty: Decimal)(integration)OnBeforeCalcLineAmount(var PurchasePrice: Record "Purchase Price"; LineDiscPerCent: Decimal; var Result: Decimal; var IsHandled: Boolean)(integration)OnBeforeConvertPriceToVAT(var VATPostingSetup: Record "VAT Posting Setup"; VATBusPostingGr: Code[20]; FromVATBusPostingGr: Code[20]; UnitPrice: Decimal; PricesInclVAT: Boolean; var IsHandled: Boolean)(integration)OnBeforeFindItemJnlLinePrice(var ItemJournalLine: Record "Item Journal Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)(integration)OnBeforeFindJobJnlLinePrice(var JobJnlLine: Record "Job Journal Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)(integration)OnBeforeFindJobPlanningLinePrice(var JobPlanningLine: Record "Job Planning Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)(integration)OnBeforeFindPurchLinePrice(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; CalledByFieldNo: Integer; var IsHandled: Boolean)(integration)OnBeforeFindPurchLineDsic(var ToPurchLineDisc: Record "Purchase Line Discount"; var VendorNo: Code[20]; var ItemNo: Code[20]; var VariantCode: Code[10]; var UOM: Code[10]; var CurrencyCode: Code[10]; var StartingDate: Date; var ShowAll: Boolean; var QuantityPerUoM: Decimal; var Quantity: Decimal)(integration)OnBeforeFindPurchPrice(var ToPurchPrice: Record "Purchase Price"; var FromPurchasePrice: Record "Purchase Price"; var VendorNo: Code[20]; var ItemNo: Code[20]; var VariantCode: Code[10]; var UOM: Code[10]; var CurrencyCode: Code[10]; var StartingDate: Date; var ShowAll: Boolean; var Qty: Decimal; var QtyPerUOM: Decimal)(integration)OnBeforeFindReqLinePrice(var TempPurchasePrice: Record "Purchase Price" temporary; var ReqLine: Record "Requisition Line"; var IsHandled: Boolean)(integration)OnBeforeFindReqLinePriceOnBeforeWith(var RequisitionLine: Record "Requisition Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)(integration)OnBeforeFindReqLineDisc(var ReqLine: Record "Requisition Line"; var TempPurchaseLineDiscount: Record "Purchase Line Discount" temporary; var IsHandled: Boolean)(integration)OnBeforeFindReqLineDiscOnBeforeWith(var RequisitionLine: Record "Requisition Line"; var IsHandled: Boolean)(integration)OnBeforeFindStdItemJnlLinePrice(var StandardItemJnlLine: Record "Standard Item Journal Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)(integration)OnBeforeGetPurchLineDisc(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)(integration)OnBeforeGetPurchLinePrice(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)(integration)OnBeforeIsInMinQty(var Item: Record Item; UnitofMeasureCode: Code[10]; MinQty: Decimal; var Result: Boolean; var IsHandled: Boolean)(integration)OnBeforeNoOfPurchLineLineDisc(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; ShowAll: Boolean; var ReturnValue: Integer; var IsHandled: Boolean)(integration)OnBeforeNoOfPurchLinePrice(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; ShowAll: Boolean; var ReturnValue: Integer; var IsHandled: Boolean)(integration)OnBeforePurchLinePriceExists(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var TempPurchasePrice: Record "Purchase Price" temporary; ShowAll: Boolean; var IsHandled: Boolean; var DateCaption: Text[30])(integration)OnBeforePurchLineLineDiscExists(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var TempPurchLineDisc: Record "Purchase Line Discount" temporary; ShowAll: Boolean; var IsHandled: Boolean; var DateCaption: Text[30])(integration)OnBeforePurchHeaderStartDate(var PurchaseHeader: Record "Purchase Header"; var DateCaption: Text[30]; var StartDate: Date; var IsHandled: Boolean)(integration)OnBeforeFindPurchLineLineDisc(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)(integration)OnCalcBestDirectUnitCostOnAfterSetUnitCost(var PurchasePrice: Record "Purchase Price")(integration)OnCalcBestDirectUnitCostOnBeforeConvertPriceToVAT(var PurchasePrice: Record "Purchase Price")(integration)OnCalcBestDirectUnitCostOnBeforeNoPriceFound(var PurchasePrice: Record "Purchase Price"; Item: Record Item; var IsHandled: Boolean; var PriceInSKU: Boolean; var StockkeepingUnit: Record "Stockkeeping Unit")+ BC28 − BC28 (integration)OnCalcBestDirectUnitCostOnAfterIsInMinQty(var PurchasePrice: Record "Purchase Price"; QuantityPerUnitOfMeasure: Decimal; Quantity: Decimal; var InMinQty: Boolean)+ BC28 (integration)OnCalcBestDirectUnitCostOnBeforeCaseStatement(var PurchasePrice: Record "Purchase Price"; var BestPurchasePrice: Record "Purchase Price"; var BestPurchPriceFound: Boolean; var IsHandled: Boolean; LineDiscPerCent: Decimal)+ BC28 (integration)OnFindJobPlanningLinePriceOnBeforeResourceFindCost(JobPlanningLine: Record "Job Planning Line"; var ResCost: Record "Resource Cost")(integration)OnFindJobJnlLinePriceOnBeforeResourceFindCost(JobJournalLine: Record "Job Journal Line"; var ResCost: Record "Resource Cost")(integration)OnGetPurchLinePriceOnAfterLookup(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var TempPurchasePrice: Record "Purchase Price" temporary)(integration)OnGetPurchLineLineDiscOnAfterLookup(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var TempPurchaseLineDiscount: Record "Purchase Line Discount" temporary)(integration)OnFindItemJnlLinePriceOnBeforeCalcBestDirectUnitCost(var ItemJournalLine: Record "Item Journal Line"; var TempPurchasePrice: Record "Purchase Price" temporary)(integration)OnFindPurchLineDiscOnAfterSetFilters(var FromPurchLineDisc: Record "Purchase Line Discount")(integration)OnFindPurchLinePriceOnBeforeRunResourceFindCost(var ResCost: record "Resource cost")(integration)OnFindJobJnlLinePriceOnBeforeCalcBestDirectUnitCost(var JobJournalLine: Record "Job Journal Line"; var TempPurchasePrice: Record "Purchase Price" temporary)(integration)
Procedures
FindPurchLinePrice(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; CalledByFieldNo: Integer)FindItemJnlLinePrice(var ItemJnlLine: Record "Item Journal Line"; CalledByFieldNo: Integer)FindReqLinePrice(var ReqLine: Record "Requisition Line"; CalledByFieldNo: Integer)FindInvtDocLinePrice(var InvtDocLine: Record "Invt. Document Line"; CalledByFieldNo: Integer)FindPurchLineLineDisc(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line")FindStdItemJnlLinePrice(var StdItemJnlLine: Record "Standard Item Journal Line"; CalledByFieldNo: Integer)FindReqLineDisc(var ReqLine: Record "Requisition Line")CalcBestDirectUnitCost(var PurchPrice: Record "Purchase Price")CalcBestLineDisc(var PurchLineDisc: Record "Purchase Line Discount")FindPurchPrice(var ToPurchPrice: Record "Purchase Price"; VendorNo: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean)FindPurchLineDisc(var ToPurchLineDisc: Record "Purchase Line Discount"; VendorNo: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean; QuantityPerUoM: Decimal; Quantity: Decimal)SetCurrency(CurrencyCode2: Code[10]; CurrencyFactor2: Decimal; ExchRateDate2: Date)SetVAT(PriceInclVAT2: Boolean; VATPerCent2: Decimal; VATBusPostingGr2: Code[20])SetUoM(Qty2: Decimal; QtyPerUoM2: Decimal)SetLineDisc(LineDiscPerCent2: Decimal)ConvertPriceLCYToFCY(CurrencyCode: Code[10]; var UnitPrice: Decimal)PurchLinePriceExists(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; ShowAll: Boolean): BooleanPurchLineLineDiscExists(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; ShowAll: Boolean): BooleanFindJobPlanningLinePrice(var JobPlanningLine: Record "Job Planning Line"; CalledByFieldNo: Integer)FindJobJnlLinePrice(var JobJnlLine: Record "Job Journal Line"; CalledByFieldNo: Integer)NoOfPurchLinePrice(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; ShowAll: Boolean): IntegerNoOfPurchLineLineDisc(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; ShowAll: Boolean): IntegerGetPurchLinePrice(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line")GetPurchLineLineDisc(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line")SetItem(ItemNo: Code[20])SetVendor(VendorNo: Code[20])FindResUnitCost(var ResJournalLine: Record "Res. Journal Line")+ BC25 − BC25 Δ BC28FindResUnitCost(var SalesLine: Record "Sales Line")+ BC25 − BC25 Δ BC28FindResUnitCost(var ServiceLine: Record Microsoft.Service.Document."Service Line")+ BC25 − BC25 Δ BC28 (obsolete 28.0: Moved to codeunit ServPriceCalcMgt)
Plus 6 local procedures.
Triggers
OnRun
Calls
From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an Object::"Name" argument. Interface dispatch and calls through events are not counted, so the list is not complete.
- Codeunit 220 “Resource-Find Cost” (4 calls:
FindJobJnlLinePrice → (object),FindJobPlanningLinePrice → (object),FindPurchLinePrice → (object), …) - Page 7189 “Get Purchase Line Disc.” (1 call:
GetPurchLineLineDisc → (object)) - Page 7190 “Get Purchase Price” (1 call:
GetPurchLinePrice → (object))
Called by
- Codeunit 7003 “Price Calculation - V15” (15 calls:
ApplyDiscountPurchHandler → FindPurchLineLineDisc,ApplyDiscountPurchHandler → FindReqLineDisc,ApplyPricePurchHandler → FindItemJnlLinePrice, …)
Recent changes
- 2026-07-30 #9448 [Extensibility Request] issue 30264: add and extend events in CalcBestDirectUnitCost (main, BC30, feature)
Deprecations
- procedure FindResUnitCost: Pending 28.0 (#if not CLEAN28), “Moved to codeunit ServPriceCalcMgt”
Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).
Ask your agent
Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: bcatlas_resolve_node(object_type: "codeunit", object_name: "Purch. Price Calc. Mgt."), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.