---
id: change/bcapps/10227
type: change
title: "#10227 Fix regression introduced by Apply-to-Oldest optimization"
summary: The Gen. Jnl.-Post Line codeunit was fixed to resolve a regression introduced by the Apply-to-Oldest optimization that affected application logic in general ledger posting.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit gen. jnl.-post line
system: finance
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:09:00.529Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: efa0b87caaf1eb59de31ff4a7e8a984bda465439
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/10227
    title: "microsoft/BCApps#10227: Fix regression introduced by Apply-to-Oldest optimization"
    date: "2026-08-14"
    commit: efa0b87caaf1eb59de31ff4a7e8a984bda465439
    t: null
    quote: Fix regression introduced by Apply-to-Oldest optimization.
links:
  learn: []
  objects:
    - object/codeunit/12
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 10227
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/10227
kind: pr
base_branch: main
major: "30"
merged_at: "2026-08-14T12:07:31Z"
author: dcenic
author_type: User
community_contribution: false
labels:
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 18
  additions: 1980
  deletions: 99
  al: 11
apps:
  - Base Application
objects_touched:
  - key: codeunit/12
    page: codeunit/12
    type: codeunit
    id: 12
    name: Gen. Jnl.-Post Line
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 646691
systems:
  - finance
quote: Fix regression introduced by Apply-to-Oldest optimization.
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #10227 Fix regression introduced by Apply-to-Oldest optimization

> The Gen. Jnl.-Post Line codeunit was fixed to resolve a regression introduced by the Apply-to-Oldest optimization that affected application logic in general ledger posting.

[Pull request](https://github.com/microsoft/BCApps/pull/10227) · merged into `main` (BC30) on 2026-08-14 by dcenic · 18 files (+1980 -99), 11 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Fixes a regression in Gen. Jnl.-Post Line caused by the Apply-to-Oldest optimization (issue #9529)
- Fix applied in the W1, NA, APAC, BE, CH, ES, FI, FR, IT, NO and RU layers
- Four new tests guard against the regression, taken from partner PR #9881
- One extra test confirms the optimization still exits early once the summed amount is enough
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 12 "Gen. Jnl.-Post Line"](../../objects/codeunit/12.md), Base Application: modified

## Context

- Work items: AB#646691
- Labels: Team: Finance
- Systems: finance
- From the description: "Fix regression introduced by Apply-to-Oldest optimization."

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