---
id: change/bcapps/13630
type: change
title: "#13630 [NL] Fix CBG applies-to ID length handling"
summary: In the NL CBG Statement Line, New Applies-to ID now returns Code[50] and payment tolerance handling stores the ID as Code[50], matching the existing field length. Longer valid applies-to IDs no longer fail during generation, increment or payment tolerance processing.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit payment tolerance management
  - table cbg statement line
system: finance
review:
  state: reviewed
  by: opus
  at: "2026-11-06T01:00:07.909Z"
  flags: []
generated:
  at: "2026-11-19T00:15:47.846Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: ae20629927663e1a7e791db5dc1af50b755a3f5a
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/13630
    title: "microsoft/BCApps#13630: [NL] Fix CBG applies-to ID length handling"
    date: "2026-11-05"
    commit: ae20629927663e1a7e791db5dc1af50b755a3f5a
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/426
    - object/table/11401-nl
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/whatsnew/whatsnew-update-22-3
      title: Update 22.3 for Microsoft Dynamics 365 Business Central 2023 Release Wave 1
      label: possibly related
      why: touches Table 11401 "CBG Statement Line (NL)"
      by: code
    - to: https://learn.microsoft.com/dynamics365/business-central/finance-payment-tolerance-and-payment-discount-tolerance
      title: Payment tolerance and payment discount tolerance
      label: possibly related
      why: Documents payment tolerance settings for invoices closing with minor payment differences.
      by: model
number: 13630
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/13630
kind: pr
base_branch: main
major: "30"
merged_at: "2026-11-05T11:31:27Z"
author: JesperSchulz
author_type: User
community_contribution: false
labels:
  - "ADO: Sync"
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 4
  additions: 222
  deletions: 6
  al: 2
apps:
  - Base Application
objects_touched:
  - key: codeunit/426
    page: codeunit/426
    type: codeunit
    id: 426
    name: Payment Tolerance Management
    app: Base Application
    status: modified
  - key: table/11401
    page: table/11401-nl
    type: table
    id: 11401
    name: CBG Statement Line
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues:
  - 9732
work_items:
  - 657901
systems:
  - finance
quote: null
joined_against:
  major: "30"
  commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
---

# #13630 [NL] Fix CBG applies-to ID length handling

> In the NL CBG Statement Line, New Applies-to ID now returns Code[50] and payment tolerance handling stores the ID as Code[50], matching the existing field length. Longer valid applies-to IDs no longer fail during generation, increment or payment tolerance processing.

[Pull request](https://github.com/microsoft/BCApps/pull/13630) · merged into `main` (BC30) on 2026-11-05 by JesperSchulz · 4 files (+222 -6), 2 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- New Applies-to ID return type and the PmtTolCBGJnl local variable changed from Code[20] to Code[50]
- First bank ID can keep the full 20-character statement document number plus its numeric suffix
- Existing increment, suffix, cash-journal selection and payment tolerance logic are unchanged
- Five tests added covering 10, 20, 21 and 50 character IDs, numeric carry, persistence and payment tolerance
- Existing 10,000-line counter test updated to use a Code[50] variable
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 426 "Payment Tolerance Management"](../../objects/codeunit/426.md), Base Application (NL layer): modified
- [Table 11401 "CBG Statement Line"](../../objects/table/11401-nl.md), Base Application (NL layer): modified

## Context

- Fixes: [#9732 CBG Statement Line"."Applies-to ID" field is Code[50] mismatch as variables used in the supporting functions are only Code[20].](https://github.com/microsoft/BCApps/issues/9732) (closed)
- Work items: AB#657901
- Labels: ADO: Sync, Team: Finance
- Systems: finance

## Possibly related

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

- [Update 22.3 for Microsoft Dynamics 365 Business Central 2023 Release Wave 1](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/whatsnew/whatsnew-update-22-3) — possibly related: touches Table 11401 "CBG Statement Line (NL)"
- [Payment tolerance and payment discount tolerance](https://learn.microsoft.com/dynamics365/business-central/finance-payment-tolerance-and-payment-discount-tolerance) — possibly related: Documents payment tolerance settings for invoices closing with minor payment differences. (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).
