---
id: object/codeunit/7320
type: object
title: Codeunit 7320 "Whse. Undo Quantity"
summary: Codeunit 7320 "Whse. Undo Quantity" in Base Application (Microsoft.Warehouse.History). 10 public procedures, 27 events. Present since at least BC23, still in BC30, changed in BC25, BC27.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "27"
  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: 7791e2dbc7bb4af793accdca1f2593b44dd289e6818dc92701fd1ce6677d343b
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Warehouse/History/WhseUndoQuantity.Codeunit.al
    title: src/Layers/W1/BaseApp/Warehouse/History/WhseUndoQuantity.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 7320
name: Whse. Undo Quantity
namespace: Microsoft.Warehouse.History
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "25"
  - "27"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 52
  events: 27
  subscribers: 0
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 1
  calls: 3
  called_by: 8
  implements: 0
---

# Codeunit 7320 "Whse. Undo Quantity"

> Codeunit 7320 "Whse. Undo Quantity" in Base Application (Microsoft.Warehouse.History). 10 public procedures, 27 events. Present since at least BC23, still in BC30, changed in BC25, BC27.

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

## Properties

| Property | Value |
|---|---|
| TableNo | Item Journal Line |
| Permissions | TableData "Whse. Item Entry Relation" = md, TableData "Posted Whse. Shipment Line" = rimd |

## Events published

- `OnAfterPostTempWhseJnlLineCache(var TempWhseJnlLine: Record "Warehouse Journal Line" temporary)` (integration)
- `OnAfterUndoPostedWhseRcptLine(var PostedWhseReceiptLine: Record "Posted Whse. Receipt Line")` (integration)
- `OnAfterUndoPostedWhseShptLine(var PostedWhseShipmentLine: Record "Posted Whse. Shipment Line")` (integration)
- `OnAfterUpdateWhseRequestRcpt(var PostedWhseReceiptLine: Record "Posted Whse. Receipt Line")` (integration)
- `OnAfterUpdateWhseRequestShpt(var PostedWhseShipmentLine: Record "Posted Whse. Shipment Line")` (integration)
- `OnBeforeGetWhseShptLineSpacing(OldPostedWhseShptLine: Record "Posted Whse. Shipment Line"; var NewPostedWhseShptLine: Record "Posted Whse. Shipment Line"; var LineSpacing: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeGetWhseRcptLineSpacing(OldPostedWhseRcptLine: Record "Posted Whse. Receipt Line"; var NewPostedWhseRcptLine: Record "Posted Whse. Receipt Line"; var LineSpacing: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeFindPostedWhseRcptLine(var PostedWhseRcptLine: Record "Posted Whse. Receipt Line"; UndoType: Integer; UndoID: Code[20]; SourceType: Integer; SourceSubtype: Integer; SourceID: Code[20]; SourceRefNo: Integer; var Ok: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeFindPostedWhseShptLine(var PostedWhseShptLine: Record "Posted Whse. Shipment Line"; UndoType: Integer; UndoID: Code[20]; SourceType: Integer; SourceSubtype: Integer; SourceID: Code[20]; SourceRefNo: Integer; var Ok: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeOldPostedWhseRcptLineModify(var PostedWhseReceiptLine: Record "Posted Whse. Receipt Line")` (integration)
- `OnBeforePostTempWhseJnlLine(var TempWhseJnlLine: Record "Warehouse Journal Line" temporary)` (integration)
- `OnBeforePostedWhseRcptLineInsert(var NewPostedWhseReceiptLine: Record "Posted Whse. Receipt Line"; OldPostedWhseReceiptLine: Record "Posted Whse. Receipt Line"; LineSpacing: Integer)` (integration)
- `OnBeforePostedWhseShptLineInsert(var NewPostedWhseShipmentLine: Record "Posted Whse. Shipment Line"; OldPostedWhseShipmentLine: Record "Posted Whse. Shipment Line"; LineSpacing: Integer)` (integration)
- `OnBeforeTempWhseJnlLineInsert(var WarehouseJournalLine: Record "Warehouse Journal Line"; WarehouseEntry: Record "Warehouse Entry"; ItemJournalLine: Record "Item Journal Line")` (integration)
- `OnBeforeUpdateWhseRequestShpt(var PostedWhseShipmentLine: Record "Posted Whse. Shipment Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeWhseRcptLineModify(var WarehouseReceiptLine: Record "Warehouse Receipt Line"; var PostedWhseReceiptLine: Record "Posted Whse. Receipt Line")` (integration)
- `OnBeforeWhseShptLineModify(var WarehouseShipmentLine: Record "Warehouse Shipment Line"; var PostedWhseShipmentLine: Record "Posted Whse. Shipment Line")` (integration)
- `OnFindPostedWhseRcptLineOnAfterSetFilters(var PostedWhseReceiptLine: Record "Posted Whse. Receipt Line")` (integration)
- `OnFindPostedWhseShptLineOnAfterSetFilters(var PostedWhseShipmentLine: Record "Posted Whse. Shipment Line")` (integration)
- `OnAfterUpdateWhseRcptLine(var PostedWhseRcptLine: Record "Posted Whse. Receipt Line"; var WhseRcptLine: Record "Warehouse Receipt Line")` (integration)
- `OnInsertTempWhseJnlLineOnAfterWhseEntrySetFilters(ItemJnlLine: Record "Item Journal Line"; SourceType: Integer; SourceSubType: Integer; SourceNo: Code[20]; SourceLineNo: Integer; RefDoc: Integer; var WhseEntry: Record "Warehouse Entry")` (integration)
- `OnInsertTempWhseJnlLineOnAfterTempWhseJnlLineInit(var ItemJnlLine: Record "Item Journal Line"; var WarehouseEntry: Record "Warehouse Entry"; var WarehouseJournalLine: Record "Warehouse Journal Line")` (integration)
- `OnPostTempWhseJnlLineCacheOnBeforeRegisterWhseJnlLine(var TempWarehouseJournalLine: Record "Warehouse Journal Line" temporary)` (integration)
- `OnBeforeUpdateWhseRcptLine(PostedWhseReceiptLine: Record "Posted Whse. Receipt Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeUpdateWhseShptLine(PostedWhseShipmentLine: Record "Posted Whse. Shipment Line"; var IsHandled: Boolean)` (integration)
- `OnAfterIsShipmentLine(UndoType: Integer; var IsShipment: Boolean)` (integration)
  - subscribers: [Codeunit 5995 "Service Warehouse Mgt."](../codeunit/5995.md) OnAfterIsSalesShipmentLine
- `OnInsertTempWhseJnlLineOnBeforeCreateWhseJnlLine(var ItemJournalLine: Record "Item Journal Line")` (integration)

## Procedures

- `InsertTempWhseJnlLine(ItemJnlLine: Record "Item Journal Line"; SourceType: Integer; SourceSubType: Integer; SourceNo: Code[20]; SourceLineNo: Integer; RefDoc: Integer; var TempWhseJnlLine: Record "Warehouse Journal Line" temporary; var NextLineNo: Integer)`
- `PostTempWhseJnlLine(var TempWhseJnlLine: Record "Warehouse Journal Line" temporary)`
- `PostTempWhseJnlLineCache(var TempWhseJnlLine: Record "Warehouse Journal Line" temporary; var WhseJnlRegLine: Codeunit "Whse. Jnl.-Register Line")`
- `UndoPostedWhseRcptLine(var PostedWhseRcptLine: Record "Posted Whse. Receipt Line")`
- `UndoPostedWhseShptLine(var PostedWhseShptLine: Record "Posted Whse. Shipment Line")`
- `UpdateRcptSourceDocLines(var PostedWhseRcptLine: Record "Posted Whse. Receipt Line")`
- `UpdateShptSourceDocLines(var PostedWhseShptLine: Record "Posted Whse. Shipment Line")`
- `FindPostedWhseRcptLine(var PostedWhseRcptLine: Record "Posted Whse. Receipt Line"; UndoType: Integer; UndoID: Code[20]; SourceType: Integer; SourceSubtype: Integer; SourceID: Code[20]; SourceRefNo: Integer): Boolean`
- `FindPostedWhseShptLine(var PostedWhseShptLine: Record "Posted Whse. Shipment Line"; UndoType: Integer; UndoID: Code[20]; SourceType: Integer; SourceSubtype: Integer; SourceID: Code[20]; SourceRefNo: Integer): Boolean`
- `InsertPostedWhseShptLine(OldPostedWhseShptLine: Record "Posted Whse. Shipment Line")`

Plus 15 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 83 "Item Journal Line"](../table/83.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 5775 "Whse. Management"](../codeunit/5775.md) (4 calls: `FindPostedWhseRcptLine → SetSourceFilterForPostedWhseRcptLine`, `FindPostedWhseShptLine → SetSourceFilterForPostedWhseShptLine`, `InsertTempWhseJnlLine → GetWhseJnlSourceDocument`, …)
- [Codeunit 7301 "Whse. Jnl.-Register Line"](../codeunit/7301.md) (1 call: `PostTempWhseJnlLineCache → RegisterWhseJnlLine`)
- [Codeunit 7302 "WMS Management"](../codeunit/7302.md) (1 call: `InsertTempWhseJnlLine → CreateWhseJnlLine`)

## Called by

- [Codeunit 5813 "Undo Purchase Receipt Line"](../codeunit/5813.md) (5 calls: `Code → FindPostedWhseRcptLine`, `Code → PostTempWhseJnlLine`, `Code → UndoPostedWhseRcptLine`, …)
- [Codeunit 5814 "Undo Return Shipment Line"](../codeunit/5814.md) (5 calls: `Code → FindPostedWhseShptLine`, `Code → PostTempWhseJnlLine`, `Code → UndoPostedWhseShptLine`, …)
- [Codeunit 5815 "Undo Sales Shipment Line"](../codeunit/5815.md) (5 calls: `Code → FindPostedWhseShptLine`, `Code → PostTempWhseJnlLineCache`, `Code → UndoPostedWhseShptLine`, …)
- [Codeunit 5816 "Undo Return Receipt Line"](../codeunit/5816.md) (5 calls: `Code → FindPostedWhseRcptLine`, `Code → PostTempWhseJnlLine`, `Code → UndoPostedWhseRcptLine`, …)
- [Codeunit 5818 "Undo Service Shipment Line"](../codeunit/5818.md) (5 calls: `Code → FindPostedWhseShptLine`, `Code → PostTempWhseJnlLine`, `Code → UndoPostedWhseShptLine`, …)
- [Codeunit 9030 "Undo Transfer Shipment"](../codeunit/9030.md) (5 calls: `Code → FindPostedWhseShptLine`, `Code → PostTempWhseJnlLineCache`, `Code → UndoPostedWhseShptLine`, …)
- [Codeunit 5819 "Undo Service Consumption Line"](../codeunit/5819.md) (2 calls: `Code → PostTempWhseJnlLine`, `PostItemJnlLine → InsertTempWhseJnlLine`)
- [Codeunit 5817 "Undo Posting Management"](../codeunit/5817.md) (1 call: `TestPostedWhseReceiptLine → FindPostedWhseRcptLine`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC25, BC27

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: "Whse. Undo Quantity")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
