Codeunit 5815 "Undo Sales Shipment Line"
Base Application · Microsoft.Sales.History
Across versions
- BC23present
- BC243 events added, 3 events removed
- BC253 procedures added, 3 events added
- BC261 procedures added, 1 events added
- BC272 procedures added
- BC286 procedures added, 2 procedures removed
- BC29-30unchanged
Neighbourhood 14 connected objects and pages
Base Application · Microsoft.Sales.History · BC23-30 · source at ea08af5e · facts from BC29
Properties
| Property | Value |
|---|---|
| TableNo | Sales Shipment Line |
| Permissions | TableData “Sales Line” = rimd, TableData “Sales Shipment Line” = rimd, TableData “Item Application Entry” = rmd, TableData “Item Entry Relation” = ri |
Events published
OnAfterCode(var SalesShipmentLine: Record "Sales Shipment Line")(integration): Raised after the undo sales shipment line process is completed.- subscribers: Codeunit 1351 “Telemetry Subscribers” SendTraceUndoSalesShipmentNoOfLines
OnAfterCopyItemJnlLineFromSalesShpt(var ItemJournalLine: Record "Item Journal Line"; SalesShipmentHeader: Record "Sales Shipment Header"; SalesShipmentLine: Record "Sales Shipment Line"; var TempWhseJnlLine: Record "Warehouse Journal Line" temporary; var WhseUndoQty: Codeunit "Whse. Undo Quantity"; var ItemLedgEntryNo: Integer; var NextLineNo: Integer; var TempGlobalItemLedgerEntry: Record "Item Ledger Entry" temporary; var TempGlobalItemEntryRelation: Record "Item Entry Relation" temporary; var IsHandled: Boolean)+ BC24 − BC24 (integration): Raised after copying the item journal line from the sales shipment during the undo process.OnAfterCheckSalesShptLine(var SalesShptLine: Record "Sales Shipment Line"; var TempItemLedgEntry: Record "Item Ledger Entry" temporary)(integration): Raised after validating that the sales shipment line can be undone.OnAfterNewSalesShptLineInsert(var NewSalesShipmentLine: Record "Sales Shipment Line"; OldSalesShipmentLine: Record "Sales Shipment Line")(integration): Raised after inserting a new correction sales shipment line during the undo process.OnAfterSalesShptLineModify(var SalesShptLine: Record "Sales Shipment Line"; DocLineNo: Integer; HideDialog: Boolean)+ BC24 − BC24 (integration): Raised after modifying the original sales shipment line during the undo process.OnAfterGetCorrectionLineNo(SalesShipmentLine: Record "Sales Shipment Line"; var Result: Integer)(integration): Raised after calculating the correction line number for the undo shipment line.OnAfterUpdateSalesLine(var SalesLine: Record "Sales Line"; var SalesShptLine: Record "Sales Shipment Line")(integration): Raised after updating the related sales order line during the undo shipment process.OnBeforeBlanketOrderInitOutstanding(var BlanketOrderSalesLine: Record "Sales Line"; SalesShipmentLine: Record "Sales Shipment Line")(integration): Raised before initializing outstanding quantities on the blanket order line during undo.OnBeforeGetCorrectionLineNo(SalesShipmentLine: Record "Sales Shipment Line"; var Result: Integer; var IsHandled: Boolean)(integration): Raised before calculating the correction line number for the undo shipment line.OnBeforeCheckSalesShptLine(var SalesShipmentLine: Record "Sales Shipment Line"; var IsHandled: Boolean; var SkipTestFields: Boolean; var SkipUndoPosting: Boolean; var SkipUndoInitPostATO: Boolean)(integration): Raised before validating that the sales shipment line can be undone.OnAfterInsertNewShipmentLine(var SalesShipmentLine: Record "Sales Shipment Line"; var PostedWhseShipmentLine: Record "Posted Whse. Shipment Line"; var PostedWhseShptLineFound: Boolean; DocLineNo: Integer; ItemShptEntryNo: Integer)(integration): Raised after inserting a new correction shipment line during the undo process.OnBeforeOnRun(var SalesShipmentLine: Record "Sales Shipment Line"; var IsHandled: Boolean; var SkipTypeCheck: Boolean; var HideDialog: Boolean)(integration): Raised before the undo sales shipment line process begins.OnBeforeNewSalesShptLineInsert(var NewSalesShipmentLine: Record "Sales Shipment Line"; OldSalesShipmentLine: Record "Sales Shipment Line")(integration): Raised before inserting a new correction sales shipment line during the undo process.- subscribers: Codeunit 6253 “Sust. Sales Subscriber” OnBeforeNewSalesShptLineInsert
OnBeforePostItemJnlLine(var SalesShipmentLine: Record "Sales Shipment Line"; var DocLineNo: Integer; var ItemLedgEntryNo: Integer; var IsHandled: Boolean; var TempGlobalItemLedgEntry: Record "Item Ledger Entry" temporary; var TempGlobalItemEntryRelation: Record "Item Entry Relation" temporary; var TempWhseJnlLine: Record "Warehouse Journal Line" temporary; var NextLineNo: Integer)(integration): Raised before posting the item journal line during the undo shipment process.OnBeforeSalesShptLineModify(var SalesShptLine: Record "Sales Shipment Line")(integration): Raised before modifying the original sales shipment line during the undo process.OnBeforeUpdateBlanketOrder(var SalesShptLine: Record "Sales Shipment Line"; var IsHandled: Boolean)(integration): Raised before updating the blanket order line during the undo shipment process.OnBeforeUpdateOrderLine(var SalesShptLine: Record "Sales Shipment Line"; var IsHandled: Boolean; var TempGlobalItemLedgEntry: Record "Item Ledger Entry" temporary)(integration): Raised before updating the sales order line during the undo shipment process.OnCodeOnBeforeUndoLoop(var SalesShptLine: Record "Sales Shipment Line")(integration): Raised before starting the undo loop for each sales shipment line.OnCodeOnAfterSalesShptLineSetFilters(var SalesShptLine: Record "Sales Shipment Line"; HideDialog: Boolean)+ BC24 − BC24 (integration): Raised after setting filters on the sales shipment lines to process.OnPostItemJnlLineOnAfterInsertTempWhseJnlLine(SalesShptLine: Record "Sales Shipment Line"; var ItemJnlLine: Record "Item Journal Line"; var TempWhseJnlLine: Record "Warehouse Journal Line" temporary; var NextLineNo: Integer)(integration): Raised after inserting a temporary warehouse journal line during item journal posting.OnPostItemJnlLineOnAfterRunItemJnlPostLine(var ItemJnlLine: Record "Item Journal Line"; var SalesShipmentLine: Record "Sales Shipment Line"; var SalesShipmentHeader: Record "Sales Shipment Header"; var ItemJnlPostLine: Codeunit "Item Jnl.-Post Line")+ BC26 − BC26 (integration): Raised after running the item journal post line during the undo shipment process.OnPostItemJnlLineOnBeforeRunItemJnlPostLine(var ItemJnlLine: Record "Item Journal Line"; ItemLedgEntryNotInvoiced: Record "Item Ledger Entry"; SalesShptLine: Record "Sales Shipment Line"; SalesShptHeader: Record "Sales Shipment Header"; var IsHandled: Boolean)(integration): Raised before running the item journal post line during the undo shipment process.- subscribers: Codeunit 6253 “Sust. Sales Subscriber” OnPostItemJnlLineOnBeforeRunItemJnlPostLine
OnUpdateOrderLineOnBeforeUpdateSalesLine(var SalesShipmentLine: Record "Sales Shipment Line"; var SalesLine: Record "Sales Line")(integration): Raised before updating the sales order line quantities during the undo process.OnAfterIsSalesInvoiceCancelled(var SalesInvoiceHeader: Record "Sales Invoice Header"; var Result: Boolean)(integration): Raised after determining whether the related sales invoice was cancelled.OnCheckSalesShptLineOnBeforeCollectItemLedgEntries(SalesShptLine: Record "Sales Shipment Line"; var TempItemLedgEntry: Record "Item Ledger Entry" temporary; var IsHandled: Boolean)(integration): Raised before collecting item ledger entries during shipment line validation.OnCheckSalesShptLineOnBeforeHasInvoicedNotReturnedQuantity(SalesShptLine: Record "Sales Shipment Line"; var IsHandled: Boolean)(integration): Raised before checking whether the line has invoiced but not returned quantity.OnSynchronizeATOOnBeforeModify(var SalesLine: Record "Sales Line")(integration): Raised before modifying the sales line during assemble-to-order synchronization.OnAfterPostItemJnlLine(var ItemJournalLine: Record "Item Journal Line"; var SalesShipmentLine: Record "Sales Shipment Line")(integration): Raised after posting the item journal line during the undo shipment process.OnItemJnlPostLineOnAfterGetInvoicedShptEntriesOnBeforeExit(var ItemJournalLine: Record "Item Journal Line"; var SalesShipmentLine: Record "Sales Shipment Line")(integration): Raised after processing invoiced shipment entries before exiting the posting routine.OnPostItemJnlLineOnAfterCalcRemQtyBase(var RemQtyBase: Decimal; var ItemJournalLine: Record "Item Journal Line"; var SalesShipmentLine: Record "Sales Shipment Line"; var ItemLedgerEntryNotInvoiced: Record "Item Ledger Entry")(integration): Raised after calculating the remaining base quantity during item journal posting.OnGetInvoicedShptEntriesOnAfterSetFilters(var ItemLedgerEntry: Record "Item Ledger Entry"; SalesShipmentLine: Record "Sales Shipment Line")(integration): Raised after setting filters to retrieve invoiced shipment entries.OnCodeOnBeforeProcessItemShptEntry(var ItemShptEntryNo: Integer; var DocLineNo: Integer; var SalesShipmentLine: Record "Sales Shipment Line"; var IsHandled: Boolean)(integration): Raised before processing item shipment entries during the undo process.- subscribers: Codeunit 8069 “Sales Subscription Line Mgmt.” RemoveQuantityInvoicedForServiceCommitmentItems
OnAfterCheckSalesShipmentLines(var SalesShipmentLine: Record "Sales Shipment Line"; var UndoSalesShptLineParams: Record "Undo Sales Shpt. Line Params")+ BC25 (integration): Raised after validating all sales shipment lines before starting the undo process.- subscribers: Codeunit 6488 “Serv. Undo Sales Shipment Line” OnAfterCheckSalesShipmentLines
OnBeforeDeleteRelatedItems(var SalesShipmentLine: Record "Sales Shipment Line"; UndoSalesShptLineParams: Record "Undo Sales Shpt. Line Params")+ BC25 (integration): Raised before deleting related items during the undo shipment process.- subscribers: Codeunit 6488 “Serv. Undo Sales Shipment Line” OnBeforeDeleteRelatedItems
OnUnApplyDropShipmentOnBeforeFindItemApplicationEntry(var ItemApplicationEntry: Record "Item Application Entry"; ItemLedgerEntry: Record "Item Ledger Entry")+ BC28 (integration): Raised before finding the item application entry for a drop shipment being unapplied.
Event subscriptions
- OnSetItemAdjmtPropertiesOnBeforeCheckModifyItem subscribes to Codeunit “Item Jnl.-Post Line” OnSetItemAdjmtPropertiesOnBeforeCheckModifyItem
Procedures
SetHideDialog(NewHideDialog: Boolean): Sets whether the confirmation dialog should be hidden when undoing sales shipment lines.SetParameters(var NewUndoSalesShptLineParams: Record "Undo Sales Shpt. Line Params")+ BC25: Sets the parameters for the undo sales shipment line operation.GetCorrectionLineNo(SalesShipmentLine2: Record "Sales Shipment Line"): Integer: Gets the line number to use for the correction line when undoing a sales shipment line.UpdateOrderLine(SalesShipmentLine2: Record "Sales Shipment Line"): Updates the related sales order line after undoing a sales shipment line.UpdateBlanketOrder(SalesShipmentLine2: Record "Sales Shipment Line"): Updates the related blanket sales order line after undoing a sales shipment line.GetInvoicedShptEntries(SalesShipmentLine2: Record "Sales Shipment Line"; var ItemLedgerEntry: Record "Item Ledger Entry"): Boolean: Gets the item ledger entries for shipments that have been invoiced but not completely invoiced.SetCalledFromUndoPurchaseReceiptLine(NewCalledFromPurchRcptLine: Boolean)+ BC28
Plus 21 local procedures.
Triggers
OnRun
Relations
- runs on Table 111 “Sales Shipment Line”
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” (7 calls:
CheckSalesShptLine → CheckItemLedgEntries,CheckSalesShptLine → CollectItemLedgEntries,CheckSalesShptLine → TestSalesShptLine, …) - Codeunit 7320 “Whse. Undo Quantity” (5 calls:
Code → FindPostedWhseShptLine,Code → PostTempWhseJnlLineCache,Code → UndoPostedWhseShptLine, …) - Codeunit 900 “Assembly-Post” (4 calls:
UndoFinalizePostATO → UndoFinalizePostATO,UndoInitPostATO → UndoInitPostATO,UndoPostATO → UndoPostATO, …) - Codeunit 5813 “Undo Purchase Receipt Line” (3 calls:
UndoPurchaseReceiptLineForDropShipment → (object),UndoPurchaseReceiptLineForDropShipment → IsUndoSalesShipmentLineForDropShipment,UndoPurchaseReceiptLineForDropShipment → SetHideDialog) - Codeunit 22 “Item Jnl.-Post Line” (2 calls:
PostItemJnlLine → (object),UnApplyDropShipment → UnApplyDropShipment) - Codeunit 5894 “Inventory Adjustment Handler” (2 calls:
MakeInventoryAdjustment → MakeAutomaticInventoryAdjustment,MakeInventoryAdjustment → SetJobUpdateProperties) - Codeunit 5402 “Unit of Measure Management” (1 call:
UpdateBlanketOrder → QtyRndPrecision) - Codeunit 7150 “Update Item Analysis View” (1 call:
OnRun → UpdateAll)
Called by
- Codeunit 5813 “Undo Purchase Receipt Line” (3 calls:
UndoDropShipmentPurchRcptLine → (object),UndoDropShipmentPurchRcptLine → SetCalledFromUndoPurchaseReceiptLine,UndoDropShipmentPurchRcptLine → SetHideDialog) - Page 131 “Posted Sales Shpt. Subform” (1 call:
UndoShipmentPosting → (object))
Recent changes
- 2026-09-17 #11367 [29.X][Repair Item][SaaS][Drop shipment reversal] Undo Shipment fails with blank Bin Code at bin-mandatory location (releases/29.x, BC29, fix)
- 2026-09-14 #11274 [Master]-[Drop shipment reversal] Undo Shipment fails with blank Bin Code at bin-mandatory location (main, BC30, fix)
- 2026-08-18 #10290 [Main] -Drop shipment undo receipt fails for service and non-inventory items. (main, BC30, fix)
- 2026-08-16 #10165 [Extensibility Request] issue 29901: expose item application entry before find (main, BC30, feature)
- 2026-08-06 #10005 Improve error messages when there are no quantities to reverse in shipped/received lines in Sales/Purchase/Transfer (main, BC30, fix)
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 Sales Shipment Line"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.