---
id: change/bcapps/14783
type: change
title: "#14783 [Performance] In Customer - Balance to Date report, avoid unnecessary checks of every closed entry in the customer's history"
summary: The Customer - Balance to Date report now skips unnecessary checks on closed ledger entries by only examining those with application details after the ending date, significantly reducing run time for customers with large transaction histories.
tier: official
language: en
tags:
  - performance
  - main
  - bc30
  - report customer - balance to date
system: sales
review:
  state: reviewed
  by: opus
  at: "2026-12-04T01:06:55.824Z"
  flags: []
generated:
  at: "2026-12-05T00:13:03.967Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 8f28d0a29c88a7207637e10a383b906560674d67
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/14783
    title: "microsoft/BCApps#14783: [Performance] In Customer - Balance to Date report, avoid unnecessary checks of every closed entry in the customer's history"
    date: "2026-12-03"
    commit: 8f28d0a29c88a7207637e10a383b906560674d67
    t: null
    quote: Report 121 Customer - Balance to Date can take tens of minutes for customers with a long transaction history.
links:
  learn: []
  objects:
    - object/report/121
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/reports/report-121
      title: Customer - Balance to Date (Report)
      label: possibly related
      why: Performance optimization in Customer - Balance to Date report specifically documents this report.
      by: model
number: 14783
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/14783
kind: pr
base_branch: main
major: "30"
merged_at: "2026-12-03T19:10:10Z"
author: dcenic
author_type: User
community_contribution: false
labels:
  - "Ownership: Manual"
  - "Team: Finance"
change_class: code
change_kind: performance
behavior_change: false
breaking: false
files:
  count: 5
  additions: 646
  deletions: 31
  al: 1
apps:
  - Base Application
objects_touched:
  - key: report/121
    page: report/121
    type: report
    id: 121
    name: Customer - Balance to Date
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports:
  - number: 14816
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/14816
fixes_issues: []
work_items:
  - 661535
systems:
  - sales
quote: Report 121 Customer - Balance to Date can take tens of minutes for customers with a long transaction history.
joined_against:
  major: "30"
  commit: f53bb0f1ecd89fde9f133f9dcaf5bf43cf5f2671
---

# #14783 [Performance] In Customer - Balance to Date report, avoid unnecessary checks of every closed entry in the customer's history

> The Customer - Balance to Date report now skips unnecessary checks on closed ledger entries by only examining those with application details after the ending date, significantly reducing run time for customers with large transaction histories.

[Pull request](https://github.com/microsoft/BCApps/pull/14783) · merged into `main` (BC30) on 2026-12-03 by dcenic · 5 files (+646 -31), 1 AL · performance · tier official · reviewed (checked by Opus)

## What changed

- Open entries up to the ending date are marked directly without individual checks
- Closed entries are only checked if they have application details after the ending date
- Single-pass entry reads with SetLoadFields and SetAutoCalcFields eliminate redundant Get and CalcFields calls
- Closing-entry posting dates are cached per customer to skip unnecessary lookups
- Totals buffer is built from marked entries to ensure consistency

## AL objects touched

- [Report 121 "Customer - Balance to Date"](../../objects/report/121.md), Base Application: modified

## Also merged into

- [#14816](https://github.com/microsoft/BCApps/pull/14816) into `releases/29.x` on 2026-12-02

## Context

- Work items: AB#661535
- Labels: Ownership: Manual, Team: Finance
- Systems: sales
- From the description: "Report 121 Customer - Balance to Date can take tens of minutes for customers with a long transaction history."

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Customer - Balance to Date (Report)](https://learn.microsoft.com/dynamics365/business-central/reports/report-121) — possibly related: Performance optimization in Customer - Balance to Date report specifically documents this report. (model-linked)

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
