---
id: object/codeunit/7000
type: object
title: Codeunit 7000 "Sales Price Calc. Mgt."
summary: Codeunit 7000 "Sales Price Calc. Mgt." in Base Application (Microsoft.Sales.Pricing). 70 public procedures, 87 events. Present since at least BC23, still in BC30, changed in BC24-25, BC28.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "28"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 01b0330ef31a2d74e52928d978bf342f5ab6e7112ea2673ab6f730010e49f6d2
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Sales/Pricing/SalesPriceCalcMgt.Codeunit.al
    title: src/Layers/W1/BaseApp/Sales/Pricing/SalesPriceCalcMgt.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/9224
    - change/bcapps/9083
object_type: codeunit
object_id: 7000
name: Sales Price Calc. Mgt.
namespace: Microsoft.Sales.Pricing
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 181
  events: 87
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 3
  called_by: 2
  implements: 0
---

# Codeunit 7000 "Sales Price Calc. Mgt."

> Codeunit 7000 "Sales Price Calc. Mgt." in Base Application (Microsoft.Sales.Pricing). 70 public procedures, 87 events. Present since at least BC23, still in BC30, changed in BC24-25, BC28.

Base Application · Microsoft.Sales.Pricing · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Sales/Pricing/SalesPriceCalcMgt.Codeunit.al) · facts from BC29

## Events published

- `OnAfterCalcBestUnitPrice(var SalesPrice: Record "Sales Price"; var BestSalesPrice: Record "Sales Price"; FoundSalesPrice: Boolean)` (integration)
- `OnAfterCalcBestUnitPriceAsItemUnitPrice(var SalesPrice: Record "Sales Price"; var Item: Record Item)` (integration)
- `OnAfterCalcLineAmount(SalesPrice: Record "Sales Price"; var LineAmount: Decimal; var LineDiscPerCent: Decimal)` (integration)
- `OnAfterCopyJobResPriceToJobJnlLine(var JobJnlLine: Record "Job Journal Line")` (integration)
- `OnAfterFindItemJnlLinePrice(var ItemJournalLine: Record "Item Journal Line"; var SalesPrice: Record "Sales Price"; CalledByFieldNo: Integer; FoundSalesPrice: Boolean)` (integration)
- `OnAfterFindJobJnlLineResPrice(var JobJournalLine: Record "Job Journal Line"; var ResourcePrice: Record "Resource Price"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnAfterFindJobJnlLineLineDisc(var JobJournalLine: Record "Job Journal Line"; var TempSalesLineDisc: Record "Sales Line Discount" temporary)` (integration)
- `OnAfterFindJobPlanningLineLineDisc(var JobPlanningLine: Record "Job Planning Line"; var TempSalesLineDisc: Record "Sales Line Discount" temporary)` (integration)
- `OnAfterFindJobPlanningLineResPrice(var JobPlanningLine: Record "Job Planning Line"; var ResourcePrice: Record "Resource Price"; CalledByFieldNo: Integer; var AllowLineDisc: Boolean; var IsHandled: Boolean)` (integration)
- `OnAfterFindStdItemJnlLinePrice(var StdItemJnlLine: Record "Standard Item Journal Line"; var SalesPrice: Record "Sales Price"; CalledByFieldNo: Integer)` (integration)
- `OnAfterFindSalesLinePrice(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var SalesPrice: Record "Sales Price"; var ResourcePrice: Record "Resource Price"; CalledByFieldNo: Integer; var FoundSalesPrice: Boolean; Qty: Decimal; QtyPerUOM: Decimal; LineDiscPerCent: Decimal; AllowLineDisc: Boolean; AllowInvDisc: Boolean; PricesInCurrency: Boolean; VATBusPostingGr: Code[20]; VATCalcType: Option "Normal VAT","Reverse Charge VAT","Full VAT","Sales Tax"; VATPerCent: Decimal; CurrencyFactor: Decimal)` (integration)
- `OnAfterFindSalesLineLineDisc(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var SalesLineDiscount: Record "Sales Line Discount")` (integration)
- `OnAfterFindSalesPrice(var ToSalesPrice: Record "Sales Price"; var FromSalesPrice: Record "Sales Price"; QtyPerUOM: Decimal; Qty: Decimal; CustNo: Code[20]; ContNo: Code[20]; CustPriceGrCode: Code[10]; CampaignNo: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean)` (integration)
- `OnAfterFindSalesLineItemPrice(var SalesLine: Record "Sales Line"; var TempSalesPrice: Record "Sales Price" temporary; var FoundSalesPrice: Boolean; CalledByFieldNo: Integer)` (integration)
- `OnAfterFindSalesLineResPrice(var SalesLine: Record "Sales Line"; var ResPrice: Record "Resource Price"; CalledByFieldNo: Integer)` (integration)
- `OnAfterFindSalesLineDisc(var ToSalesLineDisc: Record "Sales Line Discount"; CustNo: Code[20]; ContNo: Code[20]; CustDiscGrCode: Code[20]; CampaignNo: Code[20]; ItemNo: Code[20]; ItemDiscGrCode: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean)` (integration)
- `OnAfterFindServLinePrice(var ServiceLine: Record Microsoft.Service.Document."Service Line"; var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var SalesPrice: Record "Sales Price"; var ResourcePrice: Record "Resource Price"; var ServiceCost: Record Microsoft.Service.Pricing."Service Cost"; CalledByFieldNo: Integer)` (integration, obsolete 28.0)
- `OnAfterFindServLineResPrice(var ServiceLine: Record Microsoft.Service.Document."Service Line"; var ResPrice: Record "Resource Price"; var HideResUnitPriceMessage: Boolean; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration, obsolete 28.0)
- `OnAfterFindServLineDisc(var ServiceLine: Record Microsoft.Service.Document."Service Line"; var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var SalesLineDiscount: Record "Sales Line Discount")` (integration, obsolete 28.0)
- `OnAfterGetSalesLinePrice(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var TempSalesPrice: Record "Sales Price" temporary)` (integration)
- `OnAfterGetSalesLineLineDisc(var SalesLine: Record "Sales Line"; var SalesLineDiscount: Record "Sales Line Discount")` (integration)
- `OnAfterJobJnlLineFindJTPriceGLAccount(var JobJournalLine: Record "Job Journal Line")` (integration)
- `OnAfterJobJnlLineFindJTPriceItem(var JobJournalLine: Record "Job Journal Line")` (integration)
- `OnAfterJobJnlLineFindJTPriceResource(var JobJournalLine: Record "Job Journal Line")` (integration)
- `OnAfterJobJnlLineLineDiscExists(var JobJournalLine: Record "Job Journal Line")` (integration)
- `OnAfterJobPlanningLineLineDiscExists(var JobPlanningLine: Record "Job Planning Line")` (integration)
- `OnAfterSalesLineLineDiscExists(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var TempSalesLineDisc: Record "Sales Line Discount" temporary; ShowAll: Boolean)` (integration)
- `OnAfterSalesLinePriceExists(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var TempSalesPrice: Record "Sales Price" temporary; ShowAll: Boolean)` (integration)
- `OnAfterSalesLinePriceExistsProcedure(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; Res: Record Resource; var DateCaption: Text[30]; var ShowAll: Boolean; var Result: Boolean)` (integration)
- `OnAfterServLinePriceExists(var ServiceLine: Record Microsoft.Service.Document."Service Line")` (integration, obsolete 28.0)
- `OnAfterServLineLineDiscExists(var ServiceLine: Record Microsoft.Service.Document."Service Line")` (integration, obsolete 28.0)
- `OnBeforeActivatedCampaignExists(var ToCampaignTargetGr: Record "Campaign Target Group"; CustNo: Code[20]; ContNo: Code[20]; CampaignNo: Code[20]; var IsHandled: Boolean)` (integration)
- `OnBeforeCalcBestLineDisc(var SalesLineDisc: Record "Sales Line Discount"; Item: Record Item; var IsHandled: Boolean; QtyPerUOM: Decimal; Qty: Decimal)` (integration)
- `OnBeforeCalcBestUnitPrice(var SalesPrice: Record "Sales Price"; var IsHandled: Boolean)` (integration)
- `OnBeforeConvertPriceToVAT(var VATPostingSetup: Record "VAT Posting Setup"; var UnitPrice: Decimal; var IsHandled: Boolean)` (integration)
- `OnBeforeCopyJobItemPriceToJobJnlLine(var JobJnlLine: Record "Job Journal Line"; JobItemPrice: Record "Job Item Price"; var IsHandled: Boolean)` (integration)
- `OnBeforeCopyJobItemPriceToJobPlanLine(var JobPlanningLine: Record "Job Planning Line"; JobItemPrice: Record "Job Item Price"; var IsHandled: Boolean)` (integration)
- `OnBeforeCopySalesPriceToSalesPrice(var FromSalesPrice: Record "Sales Price"; var ToSalesPrice: Record "Sales Price"; var IsHandled: Boolean)` (integration)
- `OnBeforeCopySalesLineDiscToSalesLineDisc(var FromSalesLineDiscount: Record "Sales Line Discount"; var ToSalesLineDiscount: Record "Sales Line Discount"; var IsHandled: Boolean)` (integration)
- `OnBeforeFindAnalysisReportPrice(ItemNo: Code[20]; Date: Date; var UnitPrice: Decimal; var IsHandled: Boolean; var FoundSalesPrice: Boolean)` (integration)
- `OnBeforeFindItemJnlLinePrice(var ItemJournalLine: Record "Item Journal Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeFindJobJnlLinePrice(var JobJournalLine: Record "Job Journal Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeFindJobPlanningLinePrice(var JobPlanningLine: Record "Job Planning Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeFindJobJnlLineResPrice(var JobJournalLine: Record "Job Journal Line"; var ResourcePrice: Record "Resource Price")` (integration)
- `OnBeforeFindSalesPrice(var ToSalesPrice: Record "Sales Price"; var FromSalesPrice: Record "Sales Price"; var QtyPerUOM: Decimal; var Qty: Decimal; var CustNo: Code[20]; var ContNo: Code[20]; var CustPriceGrCode: Code[10]; var CampaignNo: Code[20]; var ItemNo: Code[20]; var VariantCode: Code[10]; var UOM: Code[10]; var CurrencyCode: Code[10]; var StartingDate: Date; var ShowAll: Boolean)` (integration)
- `OnBeforeFindSalesLinePrice(var SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeFindSalesLineDisc(var ToSalesLineDisc: Record "Sales Line Discount"; var CustNo: Code[20]; ContNo: Code[20]; var CustDiscGrCode: Code[20]; var CampaignNo: Code[20]; var ItemNo: Code[20]; var ItemDiscGrCode: Code[20]; var VariantCode: Code[10]; var UOM: Code[10]; var CurrencyCode: Code[10]; var StartingDate: Date; var ShowAll: Boolean)` (integration)
- `OnBeforeFindSalesLineLineDisc(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)` (integration)
- `OnBeforeFindServLinePrice(var ServiceLine: Record Microsoft.Service.Document."Service Line"; ServiceHeader: Record Microsoft.Service.Document."Service Header"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration, obsolete 28.0)
- `OnBeforeFindServLineDisc(var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var ServiceLine: Record Microsoft.Service.Document."Service Line"; var IsHandled: Boolean)` (integration, obsolete 28.0)
- `OnBeforeFindStdItemJnlLinePrice(var StandardItemJournalLine: Record "Standard Item Journal Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeGetSalesLinePrice(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeGetSalesLineLineDisc(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeGetServLinePrice(ServHeader: Record Microsoft.Service.Document."Service Header"; var ServLine: Record Microsoft.Service.Document."Service Line"; var IsHandled: Boolean)` (integration, obsolete 28.0)
- `OnBeforeGetServLineDisc(var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var ServiceLine: Record Microsoft.Service.Document."Service Line"; var IsHandled: Boolean)` (integration, obsolete 28.0)
- `OnBeforeJobJnlLineLineDiscExists(var JobJournalLine: Record "Job Journal Line")` (integration)
- `OnBeforeJobPlanningLineLineDiscExists(var JobPlanningLine: Record "Job Planning Line")` (integration)
- `OnBeforeJobPlanningLineFindJTPrice(var JobPlanningLine: Record "Job Planning Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeSalesHeaderStartDate(var SalesHeader: Record "Sales Header"; var DateCaption: Text[30]; var StartDate: Date; var IsHandled: Boolean)` (integration)
- `OnBeforeNoOfSalesLineLineDisc(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ShowAll: Boolean; var Result: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeNoOfSalesLinePrice(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ShowAll: Boolean; var Result: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeNoOfServLineLineDisc(var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var ServiceLine: Record Microsoft.Service.Document."Service Line"; ShowAll: Boolean; var Result: Integer; var IsHandled: Boolean)` (integration, obsolete 28.0)
- `OnBeforeNoOfServLinePrice(var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var ServiceLine: Record Microsoft.Service.Document."Service Line"; ShowAll: Boolean; var Result: Integer; var IsHandled: Boolean)` (integration, obsolete 28.0)
- `OnBeforeSalesLineLineDiscExists(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var TempSalesLineDisc: Record "Sales Line Discount" temporary; StartingDate: Date; Qty: Decimal; QtyPerUOM: Decimal; ShowAll: Boolean; var IsHandled: Boolean; Sender: Codeunit "Sales Price Calc. Mgt.")` (integration)
- `OnBeforeSalesLinePriceExists(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var TempSalesPrice: Record "Sales Price" temporary; Currency: Record Currency; CurrencyFactor: Decimal; StartingDate: Date; Qty: Decimal; QtyPerUOM: Decimal; ShowAll: Boolean; var InHandled: Boolean; Sender: Codeunit "Sales Price Calc. Mgt.")` (integration)
- `OnBeforeSalesLinePriceExistsProcedure(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ShowAll: Boolean; var TempSalesPrice: Record "Sales Price" temporary; var Result: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeServLinePriceExists(var ServiceLine: Record Microsoft.Service.Document."Service Line"; var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var TempSalesPrice: Record "Sales Price" temporary; ShowAll: Boolean; var IsHandled: Boolean)` (integration, obsolete 28.0)
- `OnBeforeServLineLineDiscExists(var ServiceLine: Record Microsoft.Service.Document."Service Line"; var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var TempSalesLineDisc: Record "Sales Line Discount" temporary; ShowAll: Boolean; var IsHandled: Boolean)` (integration, obsolete 28.0)
- `OnGetCustNoForSalesHeader(var SalesHeader: Record "Sales Header"; var CustomerNo: Code[20])` (integration)
- `OnFindJobJnlLinePriceOnBeforeJobJnlLineFindJTPrice(var JobJnlLine: Record "Job Journal Line")` (integration)
- `OnFindJobJnlLinePriceOnBeforeResourceGetJob(var JobJnlLine: Record "Job Journal Line"; var IsHandled: Boolean)` (integration)
- `OnFindSalesLineDiscOnAfterSetFilters(var SalesLineDiscount: Record "Sales Line Discount")` (integration)
- `OnFindSalesLineDiscOnAfterCopyItemDiscGroup(var FromSalesLineDiscount: Record "Sales Line Discount"; var ToSalesLineDiscount: Record "Sales Line Discount")` (integration)
- `OnFindSalesLineLineDiscOnBeforeCalcLineDisc(var SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var TempSalesLineDiscount: Record "Sales Line Discount" temporary; var Qty: Decimal; var QtyPerUOM: Decimal; var IsHandled: Boolean)` (integration)
- `OnJobJnlLineFindJTPriceOnAfterSetJobItemPriceFilters(var JobItemPrice: Record "Job Item Price"; JobJnlLine: Record "Job Journal Line")` (integration)
- `OnJobPlanningLineFindJTPriceOnAfterSetJobGLAccPriceFilters(var JobItemPrice: Record "Job G/L Account Price"; JobPlanningLine: Record "Job Planning Line")` (integration)
- `OnJobPlanningLineFindJTPriceOnAfterSetJobItemPriceFilters(var JobItemPrice: Record "Job Item Price"; JobPlanningLine: Record "Job Planning Line")` (integration)
- `OnJobPlanningLineFindJTPriceOnAfterSetJobResPriceFilters(var JobResPrice: Record "Job Resource Price"; JobPlanningLine: Record "Job Planning Line")` (integration)
- `OnFindJobPlanningLinePriceOnBeforeJobPlanningLineFindJTPrice(var JobPlanningLine: Record "Job Planning Line"; var ResPrice: Record "Resource Price")` (integration)
- `OnFindSalesLinePriceOnAfterSetResPrice(var SalesLine: Record "Sales Line"; var ResPrice: Record "Resource Price")` (integration)
- `OnFindSalesLinePriceOnAfterSetLineDisc(var SalesLine: Record "Sales Line"; var Qty: Decimal; var QtyPerUOM: Decimal)` (integration)
- `OnFindSalesLinePriceOnItemTypeOnAfterSetUnitPrice(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var TempSalesPrice: Record "Sales Price" temporary; CalledByFieldNo: Integer; FoundSalesPrice: Boolean)` (integration)
- `OnBeforeCalcBestUnitPriceConvertPrice(var SalesPrice: Record "Sales Price"; var IsHandled: Boolean; Item: Record "Item")` (integration)
- `OnCalcBestUnitPriceOnBeforeCalcBestUnitPriceConvertPrice(var SalesPrice: Record "Sales Price"; Qty: Decimal; var IsHandled: Boolean; var Item: Record Item; QtyPerUOM: Decimal; var BestSalesPrice: Record "Sales Price"; var BestSalesPriceFound: Boolean; VATCalcType: Option; PricesInclVAT: Boolean; VATPerCent: Decimal; PricesInCurrency: Boolean; ExchRateDate: Date; CurrencyFactor: Decimal; Currency: Record Currency; LineDiscPerCent: Decimal; VATBusPostingGr: Code[20])` (integration)
- `OnSetResPriceOnAfterInit(var ResourcePrice: Record "Resource Price")` (integration)
- `OnFindSalesLinePriceOnCalcBestUnitPrice(SalesLine: Record "Sales Line"; var TempSalesPrice: Record "Sales Price" temporary)` (integration)
- `OnBeforeValidateLineDiscountOnSalesLine(var SalesLine: Record "Sales Line"; var SalesLineDiscount: Record "Sales Line Discount" temporary; var IsHandled: Boolean)` (integration)

## Procedures

- `FindSalesLinePrice(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; CalledByFieldNo: Integer)`: Finds and applies the best price for a sales line based on customer, item, and pricing agreements.
- `FindItemJnlLinePrice(var ItemJnlLine: Record "Item Journal Line"; CalledByFieldNo: Integer)`: Finds and applies the best sales price for an item journal line.
- `FindServLinePrice(ServHeader: Record Microsoft.Service.Document."Service Header"; var ServLine: Record Microsoft.Service.Document."Service Line"; CalledByFieldNo: Integer)` (obsolete 28.0: Moved to codeunit ServPriceCalcMgt): Finds and applies the best sales price for a service line.
- `FindSalesLineLineDisc(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")`: Finds and applies the best line discount for a sales line based on customer and item discount groups.
- `FindServLineDisc(ServHeader: Record Microsoft.Service.Document."Service Header"; var ServLine: Record Microsoft.Service.Document."Service Line")` (obsolete 28.0: Moved to codeunit ServPriceCalcMgt): Finds and applies the best line discount for a service line.
- `FindStdItemJnlLinePrice(var StdItemJnlLine: Record "Standard Item Journal Line"; CalledByFieldNo: Integer)`: Finds and applies the best sales price for a standard item journal line.
- `FindAnalysisReportPrice(ItemNo: Code[20]; Date: Date): Decimal`: Finds the best sales price for an item to be used in analysis reports.
- `CalcBestUnitPrice(var SalesPrice: Record "Sales Price")`: Calculates the best unit price from a set of sales prices, considering currency, variant, and minimum quantity requirements.
- `CalcBestLineDisc(var SalesLineDisc: Record "Sales Line Discount")`: Calculates the best line discount from a set of sales line discounts, considering currency, variant, and minimum quantity requirements.
- `FindSalesPrice(var ToSalesPrice: Record "Sales Price"; CustNo: Code[20]; ContNo: Code[20]; CustPriceGrCode: Code[10]; CampaignNo: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean)`: Finds all applicable sales prices for an item based on customer, contact, price group, and campaign criteria.
- `FindSalesLineDisc(var ToSalesLineDisc: Record "Sales Line Discount"; CustNo: Code[20]; ContNo: Code[20]; CustDiscGrCode: Code[20]; CampaignNo: Code[20]; ItemNo: Code[20]; ItemDiscGrCode: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean)`: Finds all applicable sales line discounts for an item based on customer, contact, discount group, and campaign criteria.
- `CopySalesPrice(var SalesPrice: Record "Sales Price")`: Copies the temporary sales prices to the specified sales price record.
- `SetItem(ItemNo: Code[20])`: Sets the item record used for price calculations.
- `SetResPrice(Code2: Code[20]; WorkTypeCode: Code[10]; CurrencyCode: Code[10])`: Initializes the resource price record with the specified resource code, work type, and currency.
- `SetCurrency(CurrencyCode2: Code[10]; CurrencyFactor2: Decimal; ExchRateDate2: Date)`: Sets the currency parameters for price conversion calculations.
- `SetVAT(PriceInclVAT2: Boolean; VATPerCent2: Decimal; VATCalcType2: Option; VATBusPostingGr2: Code[20])`: Sets the VAT parameters for price calculations.
- `SetUoM(Qty2: Decimal; QtyPerUoM2: Decimal)`: Sets the quantity and unit of measure parameters for price calculations.
- `SetLineDisc(LineDiscPerCent2: Decimal; AllowLineDisc2: Boolean; AllowInvDisc2: Boolean)`: Sets the line discount parameters for price calculations.
- `ConvertPriceToVAT(FromPricesInclVAT: Boolean; FromVATProdPostingGr: Code[20]; FromVATBusPostingGr: Code[20]; var UnitPrice: Decimal)`: Converts a unit price between VAT-inclusive and VAT-exclusive amounts based on the VAT posting setup.
- `ConvertPriceLCYToFCY(CurrencyCode: Code[10]; var UnitPrice: Decimal)`: Converts a unit price from local currency to foreign currency if applicable, applying proper rounding.
- `GetSalesLinePrice(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")`: Opens a lookup page to allow the user to select a sales price for the sales line.
- `GetSalesLineLineDisc(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")`: Opens a lookup page to allow the user to select a line discount for the sales line.
- `SalesLinePriceExists(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ShowAll: Boolean): Boolean`: Checks whether any sales prices exist for the specified sales line.
- `SalesLineLineDiscExists(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ShowAll: Boolean): Boolean`: Checks whether any sales line discounts exist for the specified sales line.
- `GetServLinePrice(ServHeader: Record Microsoft.Service.Document."Service Header"; var ServLine: Record Microsoft.Service.Document."Service Line")` (obsolete 28.0: Moved to codeunit ServPriceCalcMgt): Gets the sales price for a service line.
- `GetServLineLineDisc(ServHeader: Record Microsoft.Service.Document."Service Header"; var ServLine: Record Microsoft.Service.Document."Service Line")` (obsolete 28.0: Moved to codeunit ServPriceCalcMgt): Gets the line discount for a service line.
- `ServLinePriceExists(ServHeader: Record Microsoft.Service.Document."Service Header"; var ServLine: Record Microsoft.Service.Document."Service Line"; ShowAll: Boolean): Boolean` (obsolete 28.0: Moved to codeunit ServPriceCalcMgt): Checks whether any sales prices exist for the service line.
- `ServLineLineDiscExists(ServHeader: Record Microsoft.Service.Document."Service Header"; var ServLine: Record Microsoft.Service.Document."Service Line"; ShowAll: Boolean): Boolean` (obsolete 28.0: Moved to codeunit ServPriceCalcMgt): Checks whether any line discounts exist for the service line.
- `ActivatedCampaignExists(var ToCampaignTargetGr: Record "Campaign Target Group"; CustNo: Code[20]; ContNo: Code[20]; CampaignNo: Code[20]): Boolean`: Checks whether any activated campaigns exist for the specified customer, contact, or campaign number.
- `SalesHeaderExchDate(SalesHeader: Record "Sales Header"): Date`: Returns the exchange rate date to use for currency conversion based on the sales header.
- `SalesHeaderStartDate(var SalesHeader: Record "Sales Header"; var DateCaption: Text[30]): Date`: Returns the starting date to use for price lookups based on the sales header document type.
- `ServHeaderExchDate(ServHeader: Record Microsoft.Service.Document."Service Header"): Date` (obsolete 28.0: Moved to codeunit ServPriceCalcMgt): Returns the exchange rate date to use for currency conversion based on the service header.
- `ServHeaderStartDate(ServHeader: Record Microsoft.Service.Document."Service Header"; var DateCaption: Text[30]): Date` (obsolete 28.0: Moved to codeunit ServPriceCalcMgt): Returns the starting date to use for price lookups based on the service header.
- `NoOfSalesLinePrice(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ShowAll: Boolean): Integer`: Returns the number of sales prices available for the specified sales line.
- `NoOfSalesLineLineDisc(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ShowAll: Boolean): Integer`: Returns the number of sales line discounts available for the specified sales line.
- `NoOfServLinePrice(ServHeader: Record Microsoft.Service.Document."Service Header"; var ServLine: Record Microsoft.Service.Document."Service Line"; ShowAll: Boolean): Integer` (obsolete 28.0: Moved to codeunit ServPriceCalcMgt): Returns the number of sales prices available for the specified service line.
- `NoOfServLineLineDisc(ServHeader: Record Microsoft.Service.Document."Service Header"; var ServLine: Record Microsoft.Service.Document."Service Line"; ShowAll: Boolean): Integer` (obsolete 28.0: Moved to codeunit ServPriceCalcMgt): Returns the number of sales line discounts available for the specified service line.
- `FindJobPlanningLinePrice(var JobPlanningLine: Record "Job Planning Line"; CalledByFieldNo: Integer)`: Finds and applies the best price for a job planning line based on customer, item, and resource pricing.
- `JobPlanningLineFindJTPrice(var JobPlanningLine: Record "Job Planning Line")`: Finds and applies job-specific prices for a job planning line based on job item prices, resource prices, or G/L account prices.
- `FindJobJnlLinePrice(var JobJnlLine: Record "Job Journal Line"; CalledByFieldNo: Integer)`: Finds and applies the best price for a job journal line based on customer, item, and resource pricing.
- `JobJnlLineFindJTPrice(var JobJnlLine: Record "Job Journal Line")`: Finds and applies job-specific prices for a job journal line based on job item prices, resource prices, or G/L account prices.
- `FindResPrice(var ResJournalLine: Record "Res. Journal Line")`: Finds and applies the resource price for a resource journal line.
- `RunOnAfterCalcBestUnitPrice(var SalesPrice: Record "Sales Price"; var BestSalesPrice: Record "Sales Price")` (internal)
- `RunOnAfterCalcBestUnitPriceAsItemUnitPrice(var SalesPrice: Record "Sales Price"; var Item2: Record Item)` (internal)
- `RunOnAfterCalcLineAmount(SalesPrice: Record "Sales Price"; var LineAmount: Decimal; var LineDiscPerCent: Decimal)` (internal)
- `RunOnAfterFindSalesPrice(var ToSalesPrice: Record "Sales Price"; var FromSalesPrice: Record "Sales Price"; QtyPerUOM: Decimal; Qty: Decimal; CustNo: Code[20]; ContNo: Code[20]; CustPriceGrCode: Code[10]; CampaignNo: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean)` (internal)
- `RunOnAfterFindSalesLineDisc(var ToSalesLineDisc: Record "Sales Line Discount"; CustNo: Code[20]; ContNo: Code[20]; CustDiscGrCode: Code[20]; CampaignNo: Code[20]; ItemNo: Code[20]; ItemDiscGrCode: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean)` (internal)
- `RunOnAfterFindServLinePrice(var ServiceLine: Record Microsoft.Service.Document."Service Line"; var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var SalesPrice: Record "Sales Price"; var ResourcePrice: Record "Resource Price"; var ServiceCost: Record Microsoft.Service.Pricing."Service Cost"; CalledByFieldNo: Integer)` (internal)
- `RunOnAfterFindServLineResPrice(var ServiceLine: Record Microsoft.Service.Document."Service Line"; var ResPrice: Record "Resource Price"; var HideResUnitPriceMessage: Boolean; CalledByFieldNo: Integer; var IsHandled: Boolean)` (internal)
- `RunOnAfterFindServLineDisc(var ServiceLine: Record Microsoft.Service.Document."Service Line"; var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var SalesLineDiscount: Record "Sales Line Discount")` (internal)
- `RunOnAfterServLinePriceExists(var ServiceLine: Record Microsoft.Service.Document."Service Line")` (internal)
- `RunOnAfterServLineLineDiscExists(var ServiceLine: Record Microsoft.Service.Document."Service Line")` (internal)
- `RunOnBeforeCalcBestLineDisc(var SalesLineDisc: Record "Sales Line Discount"; Item2: Record Item; var IsHandled: Boolean; QtyPerUOM2: Decimal; Qty2: Decimal)` (internal)
- `RunOnBeforeCalcBestUnitPrice(var SalesPrice: Record "Sales Price"; var IsHandled: Boolean)` (internal)
- `RunOnBeforeConvertPriceToVAT(var VATPostingSetup: Record "VAT Posting Setup"; var UnitPrice: Decimal; var IsHandled: Boolean)` (internal)
- `RunOnBeforeCopySalesPriceToSalesPrice(var FromSalesPrice: Record "Sales Price"; var ToSalesPrice: Record "Sales Price"; var IsHandled: Boolean)` (internal)
- `RunOnBeforeFindSalesPrice(var ToSalesPrice: Record "Sales Price"; var FromSalesPrice: Record "Sales Price"; var QtyPerUOM: Decimal; var Qty: Decimal; var CustNo: Code[20]; var ContNo: Code[20]; var CustPriceGrCode: Code[10]; var CampaignNo: Code[20]; var ItemNo: Code[20]; var VariantCode: Code[10]; var UOM: Code[10]; var CurrencyCode: Code[10]; var StartingDate: Date; var ShowAll: Boolean)` (internal)
- `RunOnBeforeFindSalesLineDisc(var ToSalesLineDisc: Record "Sales Line Discount"; var CustNo: Code[20]; ContNo: Code[20]; var CustDiscGrCode: Code[20]; var CampaignNo: Code[20]; var ItemNo: Code[20]; var ItemDiscGrCode: Code[20]; var VariantCode: Code[10]; var UOM: Code[10]; var CurrencyCode: Code[10]; var StartingDate: Date; var ShowAll: Boolean)` (internal)
- `RunOnBeforeFindServLinePrice(var ServiceLine: Record Microsoft.Service.Document."Service Line"; ServiceHeader: Record Microsoft.Service.Document."Service Header"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (internal)
- `RunOnBeforeFindServLineDisc(var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var ServiceLine: Record Microsoft.Service.Document."Service Line"; var IsHandled: Boolean)` (internal)
- `RunOnBeforeGetServLinePrice(ServHeader: Record Microsoft.Service.Document."Service Header"; var ServLine: Record Microsoft.Service.Document."Service Line"; var IsHandled: Boolean)` (internal)
- `RunOnBeforeGetServLineDisc(var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var ServiceLine: Record Microsoft.Service.Document."Service Line"; var IsHandled: Boolean)` (internal)
- `RunOnBeforeNoOfServLineLineDisc(var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var ServiceLine: Record Microsoft.Service.Document."Service Line"; ShowAll: Boolean; var Result: Integer; var IsHandled: Boolean)` (internal)
- `RunOnBeforeNoOfServLinePrice(var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var ServiceLine: Record Microsoft.Service.Document."Service Line"; ShowAll: Boolean; var Result: Integer; var IsHandled: Boolean)` (internal)
- `RunOnBeforeServLinePriceExists(var ServiceLine: Record Microsoft.Service.Document."Service Line"; var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var TempSalesPrice: Record "Sales Price" temporary; ShowAll: Boolean; var IsHandled: Boolean)` (internal)
- `RunOnBeforeServLineLineDiscExists(var ServiceLine: Record Microsoft.Service.Document."Service Line"; var ServiceHeader: Record Microsoft.Service.Document."Service Header"; var TempSalesLineDisc: Record "Sales Line Discount" temporary; ShowAll: Boolean; var IsHandled: Boolean)` (internal)
- `RunOnFindSalesLineDiscOnAfterSetFilters(var SalesLineDiscount: Record "Sales Line Discount")` (internal)
- `RunOnBeforeCalcBestUnitPriceConvertPrice(var SalesPrice: Record "Sales Price"; var IsHandled: Boolean; Item: Record "Item")` (internal)
- `RunOnCalcBestUnitPriceOnBeforeCalcBestUnitPriceConvertPrice(var SalesPrice: Record "Sales Price"; Qty: Decimal; var IsHandled: Boolean; var Item: Record Item)` (internal)
- `RunOnSetResPriceOnAfterInit(var ResourcePrice: Record "Resource Price")` (internal)

Plus 24 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 221 "Resource-Find Price"](../codeunit/221.md) (4 calls: `FindJobJnlLinePrice → (object)`, `FindJobPlanningLinePrice → (object)`, `FindResPrice → (object)`, …)
- [Page 7007 "Get Sales Price"](../page/7007.md) (1 call: `GetSalesLinePrice → (object)`)
- [Page 7009 "Get Sales Line Disc."](../page/7009.md) (1 call: `GetSalesLineLineDisc → (object)`)

## Called by

- [Codeunit 6087 "Serv. Price Calc. Mgt."](../codeunit/6087.md) (19 calls: `CalcBestLineDisc → (object)`, `CalcBestUnitPrice → (object)`, `CalcBestUnitPriceConvertPrice → (object)`, …)
- [Codeunit 7003 "Price Calculation - V15"](../codeunit/7003.md) (16 calls: `ApplyDiscountSalesHandler → FindSalesLineLineDisc`, `ApplyPriceSalesHandler → FindItemJnlLinePrice`, `ApplyPriceSalesHandler → FindJobJnlLinePrice`, …)

## Recent changes

- 2026-07-14 [#9224 [main] GitHub event batch 1746](../../changes/bcapps/9224.md) (main, BC30, fix)
- 2026-07-09 [#9083 Bug 639857: Project journal ignores task-level Bill-to Customer for pricing](../../changes/bcapps/9083.md) (main, BC30, fix)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-25, BC28

## Deprecations

- procedure RunOnAfterCalcBestUnitPrice: guarded (#if not CLEAN28)
- procedure RunOnAfterCalcBestUnitPriceAsItemUnitPrice: guarded (#if not CLEAN28)
- procedure RunOnAfterCalcLineAmount: guarded (#if not CLEAN28)
- procedure RunOnAfterFindSalesLineDisc: guarded (#if not CLEAN28)
- procedure RunOnAfterFindSalesPrice: guarded (#if not CLEAN28)
- procedure RunOnAfterFindServLineDisc: guarded (#if not CLEAN28)
- procedure RunOnAfterFindServLinePrice: guarded (#if not CLEAN28)
- procedure RunOnAfterFindServLineResPrice: guarded (#if not CLEAN28)
- procedure RunOnAfterServLineLineDiscExists: guarded (#if not CLEAN28)
- procedure RunOnAfterServLinePriceExists: guarded (#if not CLEAN28)
- procedure RunOnBeforeCalcBestLineDisc: guarded (#if not CLEAN28)
- procedure RunOnBeforeCalcBestUnitPrice: guarded (#if not CLEAN28)
- procedure RunOnBeforeCalcBestUnitPriceConvertPrice: guarded (#if not CLEAN28)
- procedure RunOnBeforeConvertPriceToVAT: guarded (#if not CLEAN28)
- procedure RunOnBeforeCopySalesPriceToSalesPrice: guarded (#if not CLEAN28)
- procedure RunOnBeforeFindSalesLineDisc: guarded (#if not CLEAN28)
- procedure RunOnBeforeFindSalesPrice: guarded (#if not CLEAN28)
- procedure RunOnBeforeFindServLineDisc: guarded (#if not CLEAN28)
- procedure RunOnBeforeFindServLinePrice: guarded (#if not CLEAN28)
- procedure RunOnBeforeGetServLineDisc: guarded (#if not CLEAN28)
- procedure RunOnBeforeGetServLinePrice: guarded (#if not CLEAN28)
- procedure RunOnBeforeNoOfServLineLineDisc: guarded (#if not CLEAN28)
- procedure RunOnBeforeNoOfServLinePrice: guarded (#if not CLEAN28)
- procedure RunOnBeforeServLineLineDiscExists: guarded (#if not CLEAN28)
- procedure RunOnBeforeServLinePriceExists: guarded (#if not CLEAN28)
- procedure RunOnCalcBestUnitPriceOnBeforeCalcBestUnitPriceConvertPrice: guarded (#if not CLEAN28)
- procedure RunOnFindSalesLineDiscOnAfterSetFilters: guarded (#if not CLEAN28)
- procedure RunOnSetResPriceOnAfterInit: guarded (#if not CLEAN28)
- procedure FindServLineDisc: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure FindServLinePrice: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure GetServLineLineDisc: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure GetServLinePrice: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure NoOfServLineLineDisc: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure NoOfServLinePrice: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnAfterFindServLineDisc: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnAfterFindServLinePrice: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnAfterFindServLineResPrice: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnAfterServLineLineDiscExists: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnAfterServLinePriceExists: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnBeforeFindServLineDisc: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnBeforeFindServLinePrice: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnBeforeGetServLineDisc: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnBeforeGetServLinePrice: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnBeforeNoOfServLineLineDisc: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnBeforeNoOfServLinePrice: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnBeforeServLineLineDiscExists: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure OnBeforeServLinePriceExists: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure ServHeaderExchDate: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure ServHeaderStartDate: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure ServLineLineDiscExists: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"
- procedure ServLinePriceExists: 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: "Sales Price Calc. Mgt.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
