---
id: object/codeunit/5814
type: object
title: Codeunit 5814 "Undo Return Shipment Line"
summary: Codeunit 5814 "Undo Return Shipment Line" in Base Application (Microsoft.Purchases.History). 2 public procedures, 16 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC24, BC26.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "26"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 0be67133e323de4f5a41a19fcd21c7de08c794855c183d1163664e8bd99b413d
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Purchases/History/UndoReturnShipmentLine.Codeunit.al
    title: src/Layers/W1/BaseApp/Purchases/History/UndoReturnShipmentLine.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10005
object_type: codeunit
object_id: 5814
name: Undo Return Shipment Line
namespace: Microsoft.Purchases.History
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "26"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 26
  events: 16
  subscribers: 1
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 3
  called_by: 1
  implements: 0
---

# Codeunit 5814 "Undo Return Shipment Line"

> Codeunit 5814 "Undo Return Shipment Line" in Base Application (Microsoft.Purchases.History). 2 public procedures, 16 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC24, BC26.

Base Application · Microsoft.Purchases.History · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Purchases/History/UndoReturnShipmentLine.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| TableNo | Return Shipment Line |
| Permissions | TableData "Purchase Line" = rimd, TableData "Item Entry Relation" = ri, TableData "Return Shipment Line" = rimd |

## Events published

- `OnAfterCode(var ReturnShipmentLine: Record "Return Shipment Line"; var UndoPostingManagement: Codeunit "Undo Posting Management")` (integration)
- `OnAfterCopyItemJnlLineFromReturnShpt(var ItemJournalLine: Record "Item Journal Line"; ReturnShipmentHeader: Record "Return Shipment Header"; ReturnShipmentLine: Record "Return Shipment Line"; var WhseUndoQty: Codeunit "Whse. Undo Quantity"; var ItemLedgEntryNo: Integer; var TempWhseJnlLine: Record "Warehouse Journal Line" temporary; var NextLineNo: Integer; var TempGlobalItemLedgerEntry: Record "Item Ledger Entry" temporary; var TempGlobalItemEntryRelation: Record "Item Entry Relation" temporary; var IsHandled: Boolean)` (integration)
- `OnAfterInsertNewReturnShptLine(var ReturnShipmentLine: Record "Return Shipment Line"; PostedWhseShptLine: Record "Posted Whse. Shipment Line"; var PostedWhseShptLineFound: Boolean; DocLineNo: Integer)` (integration)
- `OnAfterNewReturnShptLineInsert(var NewReturnShipmentLine: Record "Return Shipment Line"; OldReturnShipmentLine: Record "Return Shipment Line")` (integration)
- `OnAfterUpdatePurchLine(var PurchaseLine: Record "Purchase Line"; var ReturnShptLine: Record "Return Shipment Line")` (integration)
- `OnAfterReturnShptLineModify(var ReturnShptLine: Record "Return Shipment Line"; var TempWhseJnlLine: Record "Warehouse Journal Line" temporary; DocLineNo: Integer; var UndoPostingManagement: Codeunit "Undo Posting Management")` (integration)
- `OnBeforeGetCorrectionLineNo(ReturnShptLine: Record "Return Shipment Line"; var Result: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeCheckReturnShptLine(var ReturnShptLine: Record "Return Shipment Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeCode(var ReturnShipmentLine: Record "Return Shipment Line"; var UndoPostingManagement: Codeunit "Undo Posting Management")` (integration)
- `OnBeforeNewReturnShptLineInsert(var NewReturnShipmentLine: Record "Return Shipment Line"; OldReturnShipmentLine: Record "Return Shipment Line")` (integration)
- `OnBeforeOnRun(var ReturnShipmentLine: Record "Return Shipment Line"; var IsHandled: Boolean; var SkipTypeCheck: Boolean; var HideDialog: Boolean)` (integration)
- `OnBeforePostItemJnlLine(var ReturnShipmentLine: Record "Return Shipment Line"; DocLineNo: Integer; var ItemLedgEntryNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeReturnShptLineModify(var ReturnShptLine: Record "Return Shipment Line"; var TempWhseJnlLine: Record "Warehouse Journal Line" temporary)` (integration)
- `OnBeforeUpdateOrderLine(var ReturnShptLine: Record "Return Shipment Line"; var IsHandled: Boolean)` (integration)
- `OnUpdateOrderLineOnBeforeUpdatePurchLine(var ReturnShptLine: Record "Return Shipment Line"; var PurchaseLine: Record "Purchase Line")` (integration)
- `OnCheckReturnShptLineOnBeforeCollectItemLedgEntries(ReturnShipmentLine: Record "Return Shipment Line"; var IsHandled: Boolean)` (integration)

## Event subscriptions

- OnSetItemAdjmtPropertiesOnBeforeCheckModifyItem subscribes to Codeunit "Item Jnl.-Post Line" OnSetItemAdjmtPropertiesOnBeforeCheckModifyItem

## Procedures

- `SetHideDialog(NewHideDialog: Boolean)`
- `UpdateOrderLine(ReturnShptLine: Record "Return Shipment Line")`

Plus 7 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 6651 "Return Shipment Line"](../table/6651.md)

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 5817 "Undo Posting Management"](../codeunit/5817.md) (8 calls: `CheckReturnShptLine → CheckItemLedgEntries`, `CheckReturnShptLine → CollectItemLedgEntries`, `CheckReturnShptLine → TestReturnShptLine`, …)
- [Codeunit 7320 "Whse. Undo Quantity"](../codeunit/7320.md) (5 calls: `Code → FindPostedWhseShptLine`, `Code → PostTempWhseJnlLine`, `Code → UndoPostedWhseShptLine`, …)
- [Codeunit 5894 "Inventory Adjustment Handler"](../codeunit/5894.md) (2 calls: `MakeInventoryAdjustment → MakeAutomaticInventoryAdjustment`, `MakeInventoryAdjustment → SetJobUpdateProperties`)

## Called by

- [Page 6651 "Posted Return Shipment Subform"](../page/6651.md) (1 call: `UndoReturnShipment → (object)`)

## Recent changes

- 2026-08-06 [#10005 Improve error messages when there are no quantities to reverse in shipped/received lines in Sales/Purchase/Transfer](../../changes/bcapps/10005.md) (main, BC30, fix)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24, BC26

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Undo Return Shipment Line")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
