---
id: change/bcapps/14780
type: change
title: "#14780 [Performance] In Vendor - Balance to Date report, avoid rescanning the vendor's full application history"
summary: Report 321 'Vendor - Balance to Date' now skips rescanning the vendor's full application history when calculating totals, using marked entries instead to significantly improve performance for vendors with lengthy transaction histories.
tier: official
language: en
tags:
  - performance
  - main
  - bc30
  - report vendor - balance to date
system: purchasing
review:
  state: reviewed
  by: opus
  at: "2026-12-06T00:54:11.813Z"
  flags: []
generated:
  at: "2026-12-06T00:14:19.053Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 5d25cbbbb4801c2cc6949b56a9e5bf0549bb0006
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/14780
    title: "microsoft/BCApps#14780: [Performance] In Vendor - Balance to Date report, avoid rescanning the vendor's full application history"
    date: "2026-12-05"
    commit: 5d25cbbbb4801c2cc6949b56a9e5bf0549bb0006
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/report/321
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/payables-reports
      title: Accounts payables analytics
      label: possibly related
      why: touches Report 321 "Vendor - Balance to Date"
      by: code
    - to: https://learn.microsoft.com/dynamics365/business-central/reports/report-321
      title: Vendor - Balance to Date (Report)
      label: possibly related
      why: touches Report 321 "Vendor - Balance to Date"
      by: code
number: 14780
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/14780
kind: pr
base_branch: main
major: "30"
merged_at: "2026-12-05T09:58:47Z"
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: 514
  deletions: 46
  al: 1
apps:
  - Base Application
objects_touched:
  - key: report/321
    page: report/321
    type: report
    id: 321
    name: Vendor - Balance to Date
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports:
  - number: 14815
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/14815
fixes_issues: []
work_items:
  - 661534
systems:
  - purchasing
quote: null
joined_against:
  major: "30"
  commit: f53bb0f1ecd89fde9f133f9dcaf5bf43cf5f2671
---

# #14780 [Performance] In Vendor - Balance to Date report, avoid rescanning the vendor's full application history

> Report 321 'Vendor - Balance to Date' now skips rescanning the vendor's full application history when calculating totals, using marked entries instead to significantly improve performance for vendors with lengthy transaction histories.

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

## What changed

- CalcTotalVendorAmount now builds its temporary buffer from already-marked entries instead of filtering the entire detailed vendor ledger
- Second marking loop loads only needed fields and calculates FlowFields in a single read to reduce database round trips
- CheckVendEntryIncluded receives a pre-loaded record instead of issuing separate Get and CalcFields calls
- Closing-entry posting dates are cached per vendor to avoid redundant lookups
- Report output remains unchanged as the new logic produces identical results with correct ledger data

## AL objects touched

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

## Also merged into

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

## Context

- Work items: AB#661534
- Labels: Ownership: Manual, Team: Finance
- Systems: purchasing

## Possibly related

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

- [Accounts payables analytics](https://learn.microsoft.com/dynamics365/business-central/payables-reports) — possibly related: touches Report 321 "Vendor - Balance to Date"
- [Vendor - Balance to Date (Report)](https://learn.microsoft.com/dynamics365/business-central/reports/report-321) — possibly related: touches Report 321 "Vendor - Balance to Date"

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).
