codeunitSales & Receivablesofficial - Microsoftderived - from the source, no model text

Codeunit 1302 "Customer Mgt."

Base Application · Microsoft.Sales.Customer

Across versions

  1. BC23present
  2. BC242 events added, 1 procedures changed
  3. BC251 procedures changed, 1 procedures added
  4. BC26unchanged
  5. BC274 procedures added, 3 procedures removed
  6. BC28-30unchanged

Neighbourhood 18 connected objects and pages

Codeunit 32 "Customer Card Calculations" (calls, 23 links)Customer Card CalculationsPage 21 "Customer Card" (calls, 3 links)Customer CardCodeunit 358 "DateFilter-Calc" (calls, 2 links)Codeunit 5836 "Cost Calculation Management" (calls, 2 links)Cost Calculation ManagementPage 1611 "Office Customer Details" (calls, 2 links)Office Customer DetailsCodeunit 9082 "Calculate Customer Stats." (calls)Calculate Customer Stats.Page 41 "Sales Quote" (calls)Sales QuotePage 42 "Sales Order" (calls)Page 43 "Sales Invoice" (calls)Sales InvoicePage 45 "Sales List" (calls)Sales ListPage 507 "Blanket Sales Order" (calls)Blanket Sales OrderPage 9300 "Sales Quotes" (calls)Sales QuotesPage 9301 "Sales Invoice List" (calls)Sales Invoice ListPage 9302 "Sales Credit Memos" (calls)Sales Credit MemosPage 9305 "Sales Order List" (calls)Sales Order ListQuery 2460 "Posted Sales Invoices" (calls)Posted Sales InvoicesQuery 2461 "Posted Sales Credit Memos" (calls)Table 36 "Sales Header" (calls)

Open in the neighbourhood explorer

One hop out, from the extracted relations and call graph. Up to 40 shown; the sections below list them all.

Base Application · Microsoft.Sales.Customer · BC23-30 · source at ea08af5e · facts from BC29

Events published

  • OnAfterSetFilterForPostedDocs(var CustLedgEntry: Record "Cust. Ledger Entry") (integration): Raised after setting filters for posted customer ledger entries.
  • OnAfterSetFilterForUnpostedLines(var SalesLine: Record "Sales Line") (integration): Raised after setting filters for unposted sales lines.
  • OnBeforeGetTotalSales(CustNo: Code[20]; var Result: Decimal; var IsHandled: Boolean) (integration): Raised before calculating the total sales for a customer.
  • SkipSettingFilter(var SkipSetFilter: Boolean) (integration): Raised to allow skipping the date filter setting for current year calculations.
  • OnAfterCalculateShipBillToOptions(var ShipToOptions: Enum "Sales Ship-to Options"; var BillToOptions: Enum "Sales Bill-to Options"; SalesHeader: Record "Sales Header") + BC24 (integration): Raised after calculating the ship-to and bill-to options for a sales header.
  • OnBeforeSearchForExternalDocNo(var OriginalSalesHeader: Record "Sales Header"; var ResultFound: Boolean; var IsHandled: Boolean) + BC25 (integration): Raised before searching for duplicate external document numbers.
  • OnBeforeCalculateStatisticsWithCurrentCustomerValues(var Customer: Record Customer; var AdjmtCostLCY: Decimal; var AdjCustProfit: Decimal; var AdjProfitPct: Decimal; var CustInvDiscAmountLCY: Decimal; var CustPaymentsLCY: Decimal; var CustSalesLCY: Decimal; var CustProfit: Decimal; var IsHandled: Boolean) + BC24 (integration): Raised before calculating customer statistics using current customer field values.

Procedures

  • CalculatePaymentStats(CustomerNo: Code[20]; var Stats: Dictionary of [Text, Text]) + BC27: Calculates payment statistics for a customer including average days to pay, late payment counts, and overdue invoices.
  • CalcLastPaymentInfo(CustomerNo: Code[20]; var Stats: Dictionary of [Text, Text]) + BC27: Retrieves the last payment information for a customer including date, amount, and whether it was paid on time.
  • CalcNumberOfDistinctItemsSold(CustomerNo: Code[20]; var Stats: Dictionary of [Text, Text]) + BC27: Calculates the number of distinct items that have been sold to a customer.
  • CalculateInteractionStats(CustomerNo: Code[20]; var Stats: Dictionary of [Text, Text]) + BC27: Calculates interaction statistics for a customer including total count, last interaction date, and most frequent type.
  • CalculateStatistic(Customer: Record Customer; var AdjmtCostLCY: Decimal; var AdjCustProfit: Decimal; var AdjProfitPct: Decimal; var CustInvDiscAmountLCY: Decimal; var CustPaymentsLCY: Decimal; var CustSalesLCY: Decimal; var CustProfit: Decimal): Calculates customer statistics including sales, profit, and cost adjustments for the current fiscal year.
  • CalculateStatisticsWithCurrentCustomerValues(var Customer: Record Customer; var AdjmtCostLCY: Decimal; var AdjCustProfit: Decimal; var AdjProfitPct: Decimal; var CustInvDiscAmountLCY: Decimal; var CustPaymentsLCY: Decimal; var CustSalesLCY: Decimal; var CustProfit: Decimal): Calculates customer statistics using current customer field values without applying date filters.
  • CalcAmountsOnPostedInvoices(CustNo: Code[20]; var RecCount: Integer): Decimal: Calculates the total sales amount on posted invoices for a customer within the current year.
  • CalcAmountsOnPostedCrMemos(CustNo: Code[20]; var RecCount: Integer): Decimal: Calculates the total sales amount on posted credit memos for a customer within the current year.
  • CalcAmountsOnOrders(CustNo: Code[20]; var RecCount: Integer): Decimal: Calculates the total outstanding amount on sales orders for a customer.
  • CalcAmountsOnQuotes(CustNo: Code[20]; var RecCount: Integer): Decimal: Calculates the total outstanding amount on sales quotes for a customer.
  • CalculateAmountsWithVATOnUnpostedDocuments(CustNo: Code[20]): Decimal: Calculates the total outstanding amount including VAT on unposted invoices and credit memos for a customer.
  • CalculateAmountsOnUnpostedInvoices(CustNo: Code[20]; var RecCount: Integer): Decimal: Calculates the total outstanding amount on unposted sales invoices for a customer.
  • CalculateAmountsOnUnpostedCrMemos(CustNo: Code[20]; var RecCount: Integer): Decimal: Calculates the total outstanding amount on unposted sales credit memos for a customer.
  • DrillDownOnPostedInvoices(CustNo: Code[20]): Opens the Posted Sales Invoices page filtered for the specified customer within the current year.
  • DrillDownOnPostedCrMemo(CustNo: Code[20]): Opens the Posted Sales Credit Memos page filtered for the specified customer within the current year.
  • DrillDownOnOrders(CustNo: Code[20]): Opens the Sales Order List page filtered for the specified customer.
  • DrillDownOnQuotes(CustNo: Code[20]): Opens the Sales Quotes page filtered for the specified customer.
  • DrillDownMoneyOwedExpected(CustNo: Code[20]): Opens the Sales List page showing unposted invoices and credit memos for the specified customer.
  • DrillDownOnUnpostedInvoices(CustNo: Code[20]): Opens the Sales Invoice List page filtered for unposted invoices of the specified customer.
  • DrillDownOnUnpostedCrMemos(CustNo: Code[20]): Opens the Sales Credit Memos page filtered for unposted credit memos of the specified customer.
  • GetCurrentYearFilter(): Text[30]: Retrieves the date filter for the current fiscal year or accounting period.
  • GetTotalSales(CustNo: Code[20]): Decimal: Calculates the total sales for a customer including posted and outstanding invoices and credit memos.
  • GetYTDSales(CustNo: Code[20]): Decimal: Calculates the year-to-date sales for a customer using fiscal year totals.
  • SearchForExternalDocNo(var OriginalSalesHeader: Record "Sales Header"): Boolean + BC25: Searches for duplicate external document numbers in sales documents and posted documents.
  • CalculateShipBillToOptions(var ShipToOptions: Enum "Sales Ship-to Options"; var BillToOptions: Enum "Sales Bill-to Options"; var SalesHeader: Record "Sales Header") + BC24: Calculates the ship-to and bill-to options based on the sales header address information.

Plus 5 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.

Called by

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: "Customer Mgt."), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.

Evidence 1 sources