---
id: change/bcapps/10005
type: change
title: "#10005 Improve error messages when there are no quantities to reverse in shipped/received lines in Sales/Purchase/Transfer"
summary: Error messages when reversing shipped or received lines now distinguish between no reversible quantities and already-reversed lines, providing clearer guidance for users and AI agents.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit undo transfer shipment
  - codeunit undo purchase receipt line
  - codeunit undo return shipment line
  - codeunit undo return receipt line
  - codeunit undo sales shipment line
system: purchasing
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:10:11.413Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: f93aad3feef8dd68336960a9ae59c71879aa8131
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/10005
    title: "microsoft/BCApps#10005: Improve error messages when there are no quantities to reverse in shipped/received lines in Sales/Purchase/Transfer"
    date: "2026-08-06"
    commit: f93aad3feef8dd68336960a9ae59c71879aa8131
    t: null
    quote: Message wording is action-oriented so both users and AI agents get a clear next step.
links:
  learn: []
  objects:
    - object/codeunit/9030
    - object/codeunit/5813
    - object/codeunit/5814
    - object/codeunit/5816
    - object/codeunit/5815
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 10005
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/10005
kind: pr
base_branch: main
major: "30"
merged_at: "2026-08-06T11:15:31Z"
author: JakovljevicDusan
author_type: User
community_contribution: false
labels:
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 12
  additions: 78
  deletions: 17
  al: 6
apps:
  - Base Application
objects_touched:
  - key: codeunit/9030
    page: codeunit/9030
    type: codeunit
    id: 9030
    name: Undo Transfer Shipment
    app: Base Application
    status: modified
  - key: codeunit/5813
    page: codeunit/5813
    type: codeunit
    id: 5813
    name: Undo Purchase Receipt Line
    app: Base Application
    status: modified
  - key: codeunit/5814
    page: codeunit/5814
    type: codeunit
    id: 5814
    name: Undo Return Shipment Line
    app: Base Application
    status: modified
  - key: codeunit/5816
    page: codeunit/5816
    type: codeunit
    id: 5816
    name: Undo Return Receipt Line
    app: Base Application
    status: modified
  - key: codeunit/5815
    page: codeunit/5815
    type: codeunit
    id: 5815
    name: Undo Sales Shipment Line
    app: Base Application
    status: modified
objects_unjoined:
  - path: src/Layers/RU/BaseApp/Sales/History/UndoSalesShipmentLine.Codeunit.al
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 644161
systems:
  - purchasing
  - sales
  - inventory
quote: Message wording is action-oriented so both users and AI agents get a clear next step.
joined_against:
  major: "30"
  commit: f18567dc08e2bd162bf192e1da4d714b57eb099f
---

# #10005 Improve error messages when there are no quantities to reverse in shipped/received lines in Sales/Purchase/Transfer

> Error messages when reversing shipped or received lines now distinguish between no reversible quantities and already-reversed lines, providing clearer guidance for users and AI agents.

[Pull request](https://github.com/microsoft/BCApps/pull/10005) · merged into `main` (BC30) on 2026-08-06 by JakovljevicDusan · 12 files (+78 -17), 6 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- An empty selection after filtering (for example only comment or blank lines) now raises a new, action-oriented error
- The existing 'already reversed' error is kept only for lines that really are reversed
- Fixes the misleading message first seen in Undo Return Shipment
- Error messages are aligned across undo codeunits for sales, purchase, return and transfer documents
- Tests updated for the new messages
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 9030 "Undo Transfer Shipment"](../../objects/codeunit/9030.md), Base Application: modified
- [Codeunit 5813 "Undo Purchase Receipt Line"](../../objects/codeunit/5813.md), Base Application: modified
- [Codeunit 5814 "Undo Return Shipment Line"](../../objects/codeunit/5814.md), Base Application: modified
- [Codeunit 5816 "Undo Return Receipt Line"](../../objects/codeunit/5816.md), Base Application: modified
- [Codeunit 5815 "Undo Sales Shipment Line"](../../objects/codeunit/5815.md), Base Application: modified
- `src/Layers/RU/BaseApp/Sales/History/UndoSalesShipmentLine.Codeunit.al`: modified, not in the BC30 snapshot

## Context

- Work items: AB#644161
- Labels: Team: SCM
- Systems: purchasing, sales, inventory
- From the description: "Message wording is action-oriented so both users and AI agents get a clear next step."

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