---
title: "Codeunit 5813 Undo Purchase Receipt Line"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/5813-undo-purchase-receipt-line/
type: codeunit
id: 5813
name: "Undo Purchase Receipt Line"
app: "Base Application"
namespace: Microsoft.Purchases.History
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/5813-undo-purchase-receipt-line/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 5813 Undo Purchase Receipt Line

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/5813-undo-purchase-receipt-line/

| | |
| --- | --- |
| App | Base Application |
| Namespace | Microsoft.Purchases.History |
| Versions | 17-28 |
| Source file | Purchases/History/UndoPurchaseReceiptLine.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| SetHideDialog | (Boolean) | - | public | 17-28 | - | - |
| UpdateOrderLine | (Record Purch. Rcpt. Line) | - | public | 17-28 | - | - |
| UpdateBlanketOrder | (Record Purch. Rcpt. Line) | - | public | 17-28 | - | - |
| HasInvoicedNotReturnedQuantity | (Record Purch. Rcpt. Line) | Boolean | public | 24-28 | - | - |
| IsUndoSalesShipmentLineForDropShipment | (Boolean) | - | public | 28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterCode | (var Record Purch. Rcpt. Line) | 17-19 | - | - |
| Integration event | OnAfterCopyItemJnlLineFromPurchRcpt | (var Record Item Journal Line, Record Purch. Rcpt. Header, Record Purch. Rcpt. Line) | 17 | - | - |
| Integration event | OnAfterInsertNewReceiptLine | (var Record Purch. Rcpt. Line, Record Posted Whse. Receipt Line, var Boolean, Integer, var Record Posted Whse. Receipt Line) | 17-28 | - | - |
| Integration event | OnAfterNewPurchRcptLineInsert | (var Record Purch. Rcpt. Line, Record Purch. Rcpt. Line) | 17-23 | - | - |
| Integration event | OnAfterPurchRcptLineModify | (var Record Purch. Rcpt. Line, var Record Warehouse Journal Line) | 17-19 | - | - |
| Integration event | OnAfterUpdateOrderLine | (var Record Purch. Rcpt. Line, var Record Purchase Line) | 17-28 | - | - |
| Integration event | OnBeforeBlanketOrderInitOutstanding | (var Record Purchase Line, Record Purch. Rcpt. Line) | 17-28 | - | - |
| Integration event | OnBeforeCheckPurchRcptLine | (var Record Purch. Rcpt. Line, var Boolean) | 17-19 | - | - |
| Integration event | OnBeforeCode | (var Record Purch. Rcpt. Line) | 17-19 | - | - |
| Integration event | OnBeforeCheckPurchRcptLines | (var Record Purch. Rcpt. Line, var Dialog, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeNewPurchRcptLineInsert | (var Record Purch. Rcpt. Line, Record Purch. Rcpt. Line) | 17-28 | - | - |
| Integration event | OnBeforeOnRun | (var Record Purch. Rcpt. Line, var Boolean, var Boolean) | 17 | - | - |
| Integration event | OnBeforePostItemJnlLine | (var Record Purch. Rcpt. Line, Integer, var Integer, var Boolean, var Integer) | 17-23 | - | - |
| Integration event | OnBeforePurchRcptLineModify | (var Record Purch. Rcpt. Line, var Record Warehouse Journal Line) | 17-28 | - | - |
| Integration event | OnBeforeReapplyJobConsumptionFromApplyToEntryList | (Record Purch. Rcpt. Header, Record Purch. Rcpt. Line, Record Item Journal Line, var Record Item Ledger Entry, var Boolean) | 17-28 | - | - |
| Integration event | OnPostItemJournalInboundItemEntryPostingWithJob | (var Record Item Journal Line, Record Item Application Entry, var Boolean) | 17-28 | - | - |
| Integration event | OnPostItemJnlLineOnAfterCollectItemLedgEntries | (var Record Purch. Rcpt. Header, var Record Purch. Rcpt. Line, Record Source Code Setup, var Boolean) | 17-28 | - | - |
| Integration event | OnPostItemJnlLineOnBeforeUndoPosting | (var Record Item Journal Line, var Record Purch. Rcpt. Header, var Record Purch. Rcpt. Line, Record Source Code Setup, var Boolean) | 17-28 | - | - |
| Integration event | OnPostItemJnlLineOnBeforeUndoValuePostingWithJob | (Record Purch. Rcpt. Header, Record Purch. Rcpt. Line, var Record Item Journal Line, var Boolean) | 17-28 | - | - |
| Integration event | OnAfterCopyItemJnlLineFromPurchRcpt | (var Record Item Journal Line, Record Purch. Rcpt. Header, var Record Purch. Rcpt. Line, var Codeunit Whse. Undo Quantity) | 18-23 | - | - |
| Integration event | OnBeforeOnRun | (var Record Purch. Rcpt. Line, var Boolean, var Boolean, var Boolean) | 18-28 | - | - |
| Integration event | OnBeforeUpdateOrderLine | (var Record Purch. Rcpt. Line, var Boolean) | 18-28 | - | - |
| Integration event | OnUpdateOrderLineOnBeforeUpdatePurchLine | (var Record Purch. Rcpt. Line) | 18 | - | - |
| Integration event | OnBeforeGetCorrectionLineNo | (Record Purch. Rcpt. Line, var Integer, var Boolean) | 19-28 | - | - |
| Integration event | OnPostItemJnlLineOnAfterInsertTempWhseJnlLine | (Record Purch. Rcpt. Line, var Record Item Journal Line, var Record Warehouse Journal Line, var Integer) | 19-28 | - | - |
| Integration event | OnUpdateOrderLineOnBeforeUpdatePurchLine | (var Record Purch. Rcpt. Line, var Record Purchase Line) | 19-28 | - | - |
| Integration event | OnAfterCode | (var Record Purch. Rcpt. Line, var Codeunit Undo Posting Management) | 20-28 | - | - |
| Integration event | OnAfterPurchRcptLineModify | (var Record Purch. Rcpt. Line, var Record Warehouse Journal Line, Integer, var Codeunit Undo Posting Management) | 20-28 | - | - |
| Integration event | OnBeforeCheckPurchRcptLine | (var Record Purch. Rcpt. Line, var Boolean, var Record Item Ledger Entry) | 20-28 | - | - |
| Integration event | OnBeforeCode | (var Record Purch. Rcpt. Line, var Codeunit Undo Posting Management) | 20-28 | - | - |
| Integration event | OnBeforeUpdateBlanketOrder | (var Record Purch. Rcpt. Line, var Boolean) | 20-28 | - | - |
| Integration event | OnCheckPurchRcptLinesAfterPurchRcptLineSetFilters | (var Record Purch. Rcpt. Line) | 23-28 | - | - |
| Integration event | OnAfterCopyItemJnlLineFromPurchRcpt | (var Record Item Journal Line, Record Purch. Rcpt. Header, var Record Purch. Rcpt. Line, var Codeunit Whse. Undo Quantity, var Integer, var Integer, var Record Warehouse Journal Line, var Record Item Ledger Entry, var Record Item Entry Relation, var Boolean) | 24-28 | - | - |
| Integration event | OnAfterNewPurchRcptLineInsert | (var Record Purch. Rcpt. Line, Record Purch. Rcpt. Line, var Record Item Entry Relation, var Boolean) | 24-28 | - | - |
| Integration event | OnBeforePostItemJnlLine | (var Record Purch. Rcpt. Line, Integer, var Integer, var Boolean, var Integer, var Record Warehouse Journal Line) | 24-28 | - | - |
| Integration event | OnCheckPurchRcptLineOnBeforeCollectItemLedgEntries | (var Record Purch. Rcpt. Line, var Record Item Ledger Entry, var Boolean) | 24-28 | - | - |
| Integration event | OnCodeOnBeforeLoopPurchRcptLine | (var Record Purch. Rcpt. Line) | 25-28 | - | - |
| Integration event | OnBeforeCheckPurchRcptLineFields | (var Record Purch. Rcpt. Line, var Boolean) | 25-28 | Pending 28.0 | This event is no longer used. |
| Integration event | OnCodeOnBeforeMakeInventoryAdjustment | (var Record Purchase Line, var Record Purch. Rcpt. Line) | 25-28 | - | - |
| Integration event | OnUpdateItemJnlLineProdOrderSubcontracting | (var Record Item Journal Line, var Record Purch. Rcpt. Line, var Record Item Ledger Entry, var Boolean) | 27-28 | - | - |
| Integration event | OnCodeOnBeforeFindPostedWhseRcptLine | (var Record Purch. Rcpt. Line, var Boolean) | 28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
