Codeunit 1302 "Customer Mgt."
Base Application · Microsoft.Sales.Customer
Across versions
- BC23present
- BC242 events added, 1 procedures changed
- BC251 procedures changed, 1 procedures added
- BC26unchanged
- BC274 procedures added, 3 procedures removed
- BC28-30unchanged
Neighbourhood 18 connected objects and pages
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.
- Codeunit 32 “Customer Card Calculations” (14 calls:
CalcLastPaymentInfo → GetLastPaymentAmountLabel,CalcLastPaymentInfo → GetLastPaymentDateLabel,CalcLastPaymentInfo → GetLastPaymentOnTimeLabel, …) - Codeunit 358 “DateFilter-Calc” (2 calls:
GetCurrentYearFilter → CreateAccountingPeriodFilter,GetCurrentYearFilter → CreateFiscalYearFilter) - Codeunit 5836 “Cost Calculation Management” (2 calls:
CalculateStatisticsWithCurrentCustomerValues → CalcCustActualCostLCY,CalculateStatisticsWithCurrentCustomerValues → NonInvtblCostAmt) - Page 45 “Sales List” (1 call:
DrillDownMoneyOwedExpected → (object)) - Page 9300 “Sales Quotes” (1 call:
DrillDownOnQuotes → (object)) - Page 9301 “Sales Invoice List” (1 call:
DrillDownOnUnpostedInvoices → (object)) - Page 9302 “Sales Credit Memos” (1 call:
DrillDownOnUnpostedCrMemos → (object)) - Page 9305 “Sales Order List” (1 call:
DrillDownOnOrders → (object)) - Query 2460 “Posted Sales Invoices” (1 call:
DrillDownOnPostedInvoices → (object)) - Query 2461 “Posted Sales Credit Memos” (1 call:
DrillDownOnPostedCrMemo → (object))
Called by
- Codeunit 32 “Customer Card Calculations” (9 calls:
OnRun → CalcAmountsOnPostedCrMemos,OnRun → CalcAmountsOnPostedInvoices,OnRun → CalcNumberOfDistinctItemsSold, …) - Page 21 “Customer Card” (3 calls:
OnAfterGetCurrRecordFuncOData → CalculateStatistic,OpenCurrFiscalYearCustLedgerEntries → GetCurrentYearFilter,OpenCurrFiscalYearDetailedCustLedgerEntries → GetCurrentYearFilter) - Page 1611 “Office Customer Details” (2 calls:
GetTotalSales → GetTotalSales,GetYTDSales → GetYTDSales) - Codeunit 9082 “Calculate Customer Stats.” (1 call:
CalcLastPaymentDate → CalcLastPaymentInfo) - Page 41 “Sales Quote” (1 call:
UpdateShipToBillToGroupVisibility → CalculateShipBillToOptions) - Page 42 “Sales Order” (1 call:
UpdateShipToBillToGroupVisibility → CalculateShipBillToOptions) - Page 43 “Sales Invoice” (1 call:
UpdateShipToBillToGroupVisibility → CalculateShipBillToOptions) - Page 507 “Blanket Sales Order” (1 call:
UpdateShipToBillToGroupVisibility → CalculateShipBillToOptions) - Table 36 “Sales Header” (1 call:
FindDocumentWithSameExternalDocNo → SearchForExternalDocNo)
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.