---
id: change/bcapps/10478
type: change
title: "#10478 [Bug Fix] #254: [APIV2][Performance] Replace FindFirst/Next with FindSet when rebuilding dimension set entries"
summary: The APIV2 dimension set lines page now uses FindSet() instead of FindFirst() when rebuilding dimension entries, eliminating unnecessary database round trips and improving performance as the number of dimension lines grows.
tier: official
language: en
tags:
  - performance
  - main
  - bc30
  - page apiv2 - dimension set lines
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-16T01:17:19.363Z"
  flags: []
generated:
  at: "2026-11-20T00:15:45.369Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 8c2b4bc037407fc43e81ec26553af88188e83a4e
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/10478
    title: "microsoft/BCApps#10478: [Bug Fix] #254: [APIV2][Performance] Replace FindFirst/Next with FindSet when rebuilding dimension set entries"
    date: "2026-10-14"
    commit: 8c2b4bc037407fc43e81ec26553af88188e83a4e
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/page/30022
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-get-find-and-next-methods
      title: Get, Find, and Next methods
      label: possibly related
      why: Describes FindSet and FindFirst/Next methods used in the dimension set entry rebuild performance fix
      by: model
number: 10478
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/10478
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-14T10:27:31Z"
author: ventselartur
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "Team: Integrations"
change_class: code
change_kind: performance
behavior_change: false
breaking: false
files:
  count: 1
  additions: 1
  deletions: 1
  al: 1
apps:
  - APIV2
objects_touched:
  - key: page/30022
    page: page/30022
    type: page
    id: 30022
    name: APIV2 - Dimension Set Lines
    app: APIV2
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 644774
systems:
  - integration
quote: null
joined_against:
  major: "30"
  commit: f18567dc08e2bd162bf192e1da4d714b57eb099f
---

# #10478 [Bug Fix] #254: [APIV2][Performance] Replace FindFirst/Next with FindSet when rebuilding dimension set entries

> The APIV2 dimension set lines page now uses FindSet() instead of FindFirst() when rebuilding dimension entries, eliminating unnecessary database round trips and improving performance as the number of dimension lines grows.

[Pull request](https://github.com/microsoft/BCApps/pull/10478) · merged into `main` (BC30) on 2026-10-14 by ventselartur · 1 file (+1 -1), 1 AL · performance · tier official · reviewed (checked by Opus)

## What changed

- Replaced FindFirst() with FindSet() in the dimension-set rebuild loop on APIV2DimensionSetLines.Page.al
- FindSet() is the correct retrieval pattern for iterating an entire filtered result set
- Reduces database round trips and improves APIV2 performance with larger dimension line counts
- Functional behavior unchanged; loop logic and exit conditions remain identical
- Performance optimization with no functional defect or breaking changes

## AL objects touched

- [Page 30022 "APIV2 - Dimension Set Lines"](../../objects/page/30022.md), APIV2: modified

## Context

- Work items: AB#644774
- Labels: AL: Apps (W1), Team: Integrations
- Systems: integration

## Possibly related

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

- [Get, Find, and Next methods](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-get-find-and-next-methods) — possibly related: Describes FindSet and FindFirst/Next methods used in the dimension set entry rebuild performance fix (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).
