Codeunit 7020 "Sales Line - Price"
Base Application · Microsoft.Sales.Pricing
Across versions
- BC23present
- BC241 events added, 1 events changed
- BC25-30unchanged
Neighbourhood 2 connected objects and pages
Base Application · Microsoft.Sales.Pricing · BC23-30 · source at ea08af5e · facts from BC29
Events published
OnAfterGetAssetType(SalesLine: Record "Sales Line"; var AssetType: Enum "Price Asset Type")(integration)OnAfterAddSources(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; PriceType: Enum "Price Type"; var PriceSourceList: Codeunit "Price Source List")(integration)OnAfterFillBuffer(var PriceCalculationBuffer: Record "Price Calculation Buffer"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line")(integration)OnAfterGetDocumentDate(var DocumentDate: Date; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line")(integration)OnAfterSetPrice(var SalesLine: Record "Sales Line"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"; var SalesHeader: Record "Sales Header")(integration)OnAfterUpdate(var SalesLine: Record "Sales Line"; CurrPriceType: Enum "Price Type"; AmountType: Enum "Price Amount Type"; var SalesHeader: Record "Sales Header")(integration)OnBeforeSetPrice(var SalesLine: Record "Sales Line"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"; var IsHandled: Boolean; var SalesHeader: Record "Sales Header"; CurrPriceType: Enum "Price Type")+ BC24 − BC24 (integration)OnBeforeVerify(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var IsHandled: Boolean)(integration)OnCopyToBufferOnAfterPriceCalculationBufferMgtSet(var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; var PriceCalculationBuffer: Record "Price Calculation Buffer"; var PriceSourceList: Codeunit "Price Source List")Δ BC24 (integration)OnAfterIsDiscountAllowed(SalesLine: Record "Sales Line"; PriceCalculated: Boolean; var Result: Boolean; var SalesHeader: Record "Sales Header")(integration)OnAfterValidatePrice(var SalesLine: Record "Sales Line"; CurrPriceType: Enum "Price Type"; AmountType: Enum "Price Amount Type"; var SalesHeader: Record "Sales Header")(integration)OnAfterIsPriceUpdateNeeded(AmountType: Enum "Price Amount Type"; FoundPrice: Boolean; CalledByFieldNo: Integer; var Result: Boolean; SalesLine: Record "Sales Line")(integration)OnAfterFindContactCompanyCampaigns(ContactNo: Code[20]; var TempCampaignTargetGr: Record "Campaign Target Group" temporary; var Found: Boolean)(integration)OnAfterFindCustomerCampaigns(CustomerNo: Code[20]; var TempCampaignTargetGr: Record "Campaign Target Group" temporary; var Found: Boolean)(integration)
Procedures
GetTableNo(): Integer: Returns the database table number for the Sales Line table.SetLine(PriceType: Enum "Price Type"; Line: Variant): Sets the sales line and price type for price calculation, initializing the price sources.SetLine(PriceType: Enum "Price Type"; Header: Variant; Line: Variant): Sets the sales header, sales line, and price type for price calculation, clearing existing data and initializing price sources.SetSources(var NewPriceSourceList: codeunit "Price Source List"): Copies the specified price source list to the internal price source list.GetLine(var Line: Variant): Retrieves the current sales line record.GetLine(var Header: Variant; var Line: Variant): Retrieves the current sales header and sales line records.GetPriceType(): Enum "Price Type": Returns the current price type used for price calculation.IsPriceUpdateNeeded(AmountType: enum "Price Amount Type"; FoundPrice: Boolean; CalledByFieldNo: Integer): Boolean: Determines whether a price update is needed based on the amount type, whether a price was found, and the field that triggered the calculation.IsDiscountAllowed(): Boolean: Determines whether a line discount is allowed for the sales line based on the line settings and whether a price has been calculated.Verify(): Verifies that the sales line has valid data for price calculation, including quantity per unit of measure and currency factor.SetAssetSourceForSetup(var DtldPriceCalculationSetup: Record "Dtld. Price Calculation Setup"): Boolean: Initializes the detailed price calculation setup record with asset information from the sales line.GetAssetType(): Enum "Price Asset Type": Determines the price asset type based on the sales line type (Item, Resource, or G/L Account).CopyToBuffer(var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."): Boolean: Copies the sales line data to the price calculation buffer for price calculation processing.SetPrice(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"): Applies the price or discount from the price list line to the sales line based on the amount type and price type.ValidatePrice(AmountType: enum "Price Amount Type"): Validates the price or discount on the sales line after it has been set, triggering field validation logic.Update(AmountType: enum "Price Amount Type"): Updates the sales line after price calculation, clearing the line discount if not allowed.AddActivatedCampaignsAsSource(): Adds all activated campaigns associated with the customer or contact as price sources.
Plus 8 local procedures.
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 7011 “Price Source List” (8 calls:
AddActivatedCampaignsAsSource → Add,AddCustomerSources → Add,AddSources → Add, …) - Codeunit 7008 “Price Calculation Buffer Mgt.” (1 call:
CopyToBuffer → Set)
Implements
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 Line - Price"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.