---
id: change/bcapps/9745
type: change
title: "#9745 [main] Implement item variant caching in calculate inventory"
summary: The Calculate Inventory report now caches item variant information to reduce redundant database lookups when processing multiple records with the same variants.
tier: official
language: en
tags:
  - performance
  - main
  - bc30
  - report calculate inventory
system: inventory
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:10:51.183Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: e6b9071bdfad0d560fed8858f1b015d42118ecc4
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9745
    title: "microsoft/BCApps#9745: [main] Implement item variant caching in calculate inventory"
    date: "2026-07-30"
    commit: e6b9071bdfad0d560fed8858f1b015d42118ecc4
    t: null
    quote: "Caches processed Item Variants in the dictionary: whether Item Variants exists and Blocked state."
links:
  learn: []
  objects:
    - object/report/790
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9745
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9745
kind: pr
base_branch: main
major: "30"
merged_at: "2026-07-30T10:11:26Z"
author: JakovljevicDusan
author_type: User
community_contribution: false
labels:
  - "Team: SCM"
change_class: code
change_kind: performance
behavior_change: false
breaking: false
files:
  count: 2
  additions: 160
  deletions: 32
  al: 2
apps:
  - Base Application
objects_touched:
  - key: report/790
    page: report/790
    type: report
    id: 790
    name: Calculate Inventory
    app: Base Application
    status: modified
objects_unjoined:
  - path: src/Layers/RU/BaseApp/Inventory/Counting/Journal/CalculateInventory.Report.al
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 643995
systems:
  - inventory
quote: "Caches processed Item Variants in the dictionary: whether Item Variants exists and Blocked state."
joined_against:
  major: "30"
  commit: f18567dc08e2bd162bf192e1da4d714b57eb099f
---

# #9745 [main] Implement item variant caching in calculate inventory

> The Calculate Inventory report now caches item variant information to reduce redundant database lookups when processing multiple records with the same variants.

[Pull request](https://github.com/microsoft/BCApps/pull/9745) · merged into `main` (BC30) on 2026-07-30 by JakovljevicDusan · 2 files (+160 -32), 2 AL · performance · tier official · reviewed (checked by Opus)

## What changed

- Item variant existence and blocked state are cached in a dictionary during calculation
- Reduces repeated NST data cache checks and SQL queries for the same variants
- Improves performance in scenarios where many records share the same variants
- Dictionary approach eliminates NST cache maintenance overhead

## AL objects touched

- [Report 790 "Calculate Inventory"](../../objects/report/790.md), Base Application: modified
- `src/Layers/RU/BaseApp/Inventory/Counting/Journal/CalculateInventory.Report.al`: modified, not in the BC30 snapshot

## Context

- Work items: AB#643995
- Labels: Team: SCM
- Systems: inventory
- From the description: "Caches processed Item Variants in the dictionary: whether Item Variants exists and Blocked state."

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