---
id: object/codeunit/108
type: object
title: Codeunit 108 "Net Cust/Vend Balances Mgt."
summary: Codeunit 108 "Net Cust/Vend Balances Mgt." in Base Application (Microsoft.Finance.ReceivablesPayables). 2 public procedures, 10 events. Present since at least BC23, still in BC30, changed in BC25.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "25"
  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: f60fa84f31c811667f29c08c1d07078b889b7c03e6eef366c01b66e147e27859
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Finance/ReceivablesPayables/NetCustVendBalancesMgt.Codeunit.al
    title: src/Layers/W1/BaseApp/Finance/ReceivablesPayables/NetCustVendBalancesMgt.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/10878
object_type: codeunit
object_id: 108
name: Net Cust/Vend Balances Mgt.
namespace: Microsoft.Finance.ReceivablesPayables
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "25"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 30
  events: 10
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 1
  called_by: 0
  implements: 0
---

# Codeunit 108 "Net Cust/Vend Balances Mgt."

> Codeunit 108 "Net Cust/Vend Balances Mgt." in Base Application (Microsoft.Finance.ReceivablesPayables). 2 public procedures, 10 events. Present since at least BC23, still in BC30, changed in BC25.

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

## Events published

- `OnAfterInitGenJnlLine(var GenJnlLine: Record "Gen. Journal Line"; VendLedgEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised after initializing a general journal line from vendor ledger entry data. Enables custom modifications to journal line fields during net balance processing.
- `OnAfterFillGenJnlLineFromCustLedgEntry(var GenJnlLine: Record "Gen. Journal Line"; CustLedgEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised after filling general journal line from customer ledger entry. Allows customization of journal line fields based on customer ledger entry data.
- `OnAfterFillGenJnlLineFromVendLedgEntry(var GenJnlLine: Record "Gen. Journal Line"; VendLedgEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised after filling general journal line from vendor ledger entry. Enables modification of journal line fields derived from vendor ledger entry data.
- `OnCalcPartNetAmountAfterSetDocumentType(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var CustLedgerEntry: Record "Cust. Ledger Entry"; var VendNetAmount: Decimal; var CustNetAmount: Decimal; DocType: Enum "Gen. Journal Document Type"; var IsHandled: Boolean)` (integration): Integration event raised after calculating partial net amounts and setting document type. Allows custom logic for determining net amounts and handling special document type scenarios.
- `OnFillGenJnlLineFromCustledgEntryBeforeValidateAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised before validating amount on journal line created from customer ledger entry. Enables custom amount calculation or validation logic for customer entries.
- `OnFillGenJnlLineFromVendLedgEntryBeforeValidateAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before validating amount on journal line created from vendor ledger entry. Allows custom amount calculation or validation logic for vendor entries.
- `OnNetBalancesBeforeSetCustomerRemainingAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised before setting customer remaining amount during net balance processing. Enables custom logic for determining customer remaining amount calculations.
- `OnNetBalancesBeforeSetVendorRemainingAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before setting vendor remaining amount during net balance processing. Allows custom logic for determining vendor remaining amount calculations.
- `OnSumCustomerRemainingAmountBeforeCalcResult(var CustLedgerEntry: Record "Cust. Ledger Entry"; var Result: Decimal; var IsHandled: Boolean)` (integration): Integration event raised before calculating the sum of customer remaining amounts. Enables custom calculation logic for customer remaining amount totals.
- `OnSumVendorRemainingAmountBeforeCalcResult(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var Result: Decimal; var IsHandled: Boolean)` (integration): Integration event raised before calculating the sum of vendor remaining amounts. Allows custom calculation logic for vendor remaining amount totals.

## Procedures

- `NetCustVendBalances(var Vendor: Record Vendor; NewNetBalancesParameters: Record "Net Balances Parameters")`: Processes vendors to identify linked customers and creates netted balance journal entries. Calculates net amounts between customer and vendor balances for the same business partner.
- `SetGenJnlLine(NewGenJnlLine: Record "Gen. Journal Line")`: Sets the general journal line template for both vendor and customer journal entries. Copies line information to be used for creating netted balance entries.

Plus 18 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 103 "Cust. Entry-Edit"](../codeunit/103.md) (1 call: `SetOnHold → SetOnHold`)

## Recent changes

- 2026-09-03 [#10878 Ruleset hardening: promote five low-risk rules to Error](../../changes/bcapps/10878.md) (main, BC30, refactor)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC25

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: "Net Cust/Vend Balances Mgt.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
