---
id: change/bcapps/12309
type: change
title: "#12309 Fix infinite recursion in Config. Package Field XML name generation"
summary: Fixed infinite recursion in XML element name generation when configuration package fields produce duplicate XML names by replacing recursion with a bounded loop that appends counters and properly shortens base names.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - table config. package field
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:01:54.887Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 6fd8c9a15d7dce965abde7a28de47f574febf4c4
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12309
    title: "microsoft/BCApps#12309: Fix infinite recursion in Config. Package Field XML name generation"
    date: "2026-10-06"
    commit: 6fd8c9a15d7dce965abde7a28de47f574febf4c4
    t: null
    quote: Adding a table to a Configuration Package could run out of memory or stack while generating package fields.
links:
  learn: []
  objects:
    - object/table/8616
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 12309
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12309
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-06T14:50:55Z"
author: darjoo
author_type: User
community_contribution: false
labels:
  - "Team: Integrations"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 66
  deletions: 7
  al: 1
apps:
  - Base Application
objects_touched:
  - key: table/8616
    page: table/8616
    type: table
    id: 8616
    name: Config. Package Field
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 652923
systems:
  - development
quote: Adding a table to a Configuration Package could run out of memory or stack while generating package fields.
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #12309 Fix infinite recursion in Config. Package Field XML name generation

> Fixed infinite recursion in XML element name generation when configuration package fields produce duplicate XML names by replacing recursion with a bounded loop that appends counters and properly shortens base names.

[Pull request](https://github.com/microsoft/BCApps/pull/12309) · merged into `main` (BC30) on 2026-10-06 by darjoo · 2 files (+66 -7), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Prevents stack overflow and out-of-memory errors when adding tables to Configuration Packages with field name collisions
- Replaces unbounded recursion with bounded loop using counter suffix approach
- Ensures suffix always fits within 30-character field name limit by shortening base name first
- Maintains backward compatibility for existing packages and correctly resolved names
- Added tests verifying behavior with maximum-length field names that previously caused hangs
- Behaviour changes for users or extensions.

## AL objects touched

- [Table 8616 "Config. Package Field"](../../objects/table/8616.md), Base Application: modified

## Context

- Work items: AB#652923
- Labels: Team: Integrations
- Systems: development
- From the description: "Adding a table to a Configuration Package could run out of memory or stack while generating package fields."

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