---
id: change/bcapps/13294
type: change
title: "#13294 [29.x]-Exporting vendor remittance gets stuck when a payment jour nal is sorted by Document No."
summary: Fixed an issue where exporting vendor remittance advice from a payment journal sorted by Document No. would hang indefinitely by ensuring lines are processed in primary key order instead of the current sort order.
tier: official
language: en
tags:
  - fix
  - releases/29.x
  - bc29
  - codeunit bulk vendor remit reporting
system: finance
review:
  state: reviewed
  by: opus
  at: "2026-10-31T01:04:09.038Z"
  flags: []
generated:
  at: "2026-11-01T00:17:21.384Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: df75d6069a075c6c0963ec0bd30d19f4607e64cc
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/13294
    title: "microsoft/BCApps#13294: [29.x]-Exporting vendor remittance gets stuck when a payment jour nal is sorted by Document No."
    date: "2026-10-30"
    commit: df75d6069a075c6c0963ec0bd30d19f4607e64cc
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/10250-ca
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/ui-extensions-send-remittance-advice
      title: Send Remittance Advice Extension | Microsoft Docs
      label: possibly related
      why: Describes remittance advice export functionality for vendor payments, which the codeunit handles.
      by: model
number: 13294
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/13294
kind: pr
base_branch: releases/29.x
major: "29"
merged_at: "2026-10-30T10:47:27Z"
author: DhavalMore88
author_type: User
community_contribution: true
labels:
  - "ADO: Sync"
  - From Fork
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 52
  deletions: 0
  al: 1
apps:
  - Base Application
objects_touched:
  - key: codeunit/10250
    page: codeunit/10250-ca
    type: codeunit
    id: 10250
    name: Bulk Vendor Remit Reporting
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 654023
systems:
  - finance
quote: null
joined_against:
  major: "29"
  commit: 7aa49e808916c060dbee97d9ff324a2cfda8d422
---

# #13294 [29.x]-Exporting vendor remittance gets stuck when a payment jour nal is sorted by Document No.

> Fixed an issue where exporting vendor remittance advice from a payment journal sorted by Document No. would hang indefinitely by ensuring lines are processed in primary key order instead of the current sort order.

[Pull request](https://github.com/microsoft/BCApps/pull/13294) · merged into `releases/29.x` (BC29) on 2026-10-30 by DhavalMore88 (community contribution) · 2 files (+52 -0), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Vendor remittance export now completes successfully when payment journal is sorted by Document No.
- Solution uses SetCurrentKey to force processing by primary key (Journal Template Name, Journal Batch Name, Line No.) which doesn't change during export.
- Prevents infinite loop caused by Document No. changes moving already-processed lines ahead in sort order.
- Added regression test ExportPaymentJournalSortedByDocumentNo to prevent recurrence.
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 10250 "Bulk Vendor Remit Reporting"](../../objects/codeunit/10250-ca.md), Base Application (CA layer): modified

## Context

- Work items: AB#654023
- Labels: ADO: Sync, From Fork, 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.

- [Send Remittance Advice Extension | Microsoft Docs](https://learn.microsoft.com/dynamics365/business-central/ui-extensions-send-remittance-advice) — possibly related: Describes remittance advice export functionality for vendor payments, which the codeunit handles. (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).
