{"title":"Codeunit 5813 Undo Purchase Receipt Line, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/5813-undo-purchase-receipt-line/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"codeunit","id":5813,"name":"Undo Purchase Receipt Line","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/5813-undo-purchase-receipt-line/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/5813-undo-purchase-receipt-line/source/","path":"src/Layers/W1/BaseApp/Purchases/History/UndoPurchaseReceiptLine.Codeunit.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"table:32":{"name":"Item Ledger Entry","url":"https://jonas-paprotka.de/ref/table/32-item-ledger-entry/"},"table:6507":{"name":"Item Entry Relation","url":"https://jonas-paprotka.de/ref/table/6507-item-entry-relation/"},"codeunit:7320":{"name":"Whse. Undo Quantity","url":"https://jonas-paprotka.de/ref/codeunit/7320-whse-undo-quantity/"},"table:121":{"name":"Purch. Rcpt. Line","url":"https://jonas-paprotka.de/ref/table/121-purch-rcpt-line/"},"codeunit:5817":{"name":"Undo Posting Management","url":"https://jonas-paprotka.de/ref/codeunit/5817-undo-posting-management/"},"table:339":{"name":"Item Application Entry","url":"https://jonas-paprotka.de/ref/table/339-item-application-entry/"},"codeunit:22":{"name":"Item Jnl.-Post Line","url":"https://jonas-paprotka.de/ref/codeunit/22-item-jnl-post-line/"},"codeunit:5402":{"name":"Unit of Measure Management","url":"https://jonas-paprotka.de/ref/codeunit/5402-unit-of-measure-management/"},"codeunit:5801":{"name":"Show Applied Entries","url":"https://jonas-paprotka.de/ref/codeunit/5801-show-applied-entries/"},"table:39":{"name":"Purchase Line","url":"https://jonas-paprotka.de/ref/table/39-purchase-line/"},"codeunit:5894":{"name":"Inventory Adjustment Handler","url":"https://jonas-paprotka.de/ref/codeunit/5894-inventory-adjustment-handler/"},"table:313":{"name":"Inventory Setup","url":"https://jonas-paprotka.de/ref/table/313-inventory-setup/"},"codeunit:5815":{"name":"Undo Sales Shipment Line","url":"https://jonas-paprotka.de/ref/codeunit/5815-undo-sales-shipment-line/"}},"procs":[{"name":"OnRun","line":32,"kind":"trigger","steps":[[38,"event","OnBeforeOnRun",1],[47,"call","Code",0]]},{"name":"Code","line":81,"kind":"procedure","access":"local","params":0,"steps":[[91,"event","OnBeforeCode",0],[93,"call","CheckPurchRcptLines",2],[97,"event","OnCodeOnBeforeLoopPurchRcptLine",0],[101,"write",32,"DeleteAll"],[104,"write",6507,"DeleteAll"],[109,"call","UndoDropShipmentPurchRcptLine",1],[112,"event","OnCodeOnBeforeFindPostedWhseRcptLine",0],[115,"ext","codeunit",7320,"FindPostedWhseRcptLine",7],[124,"call","PostItemJnlLine",2],[126,"call","GetCorrectionLineNo",1],[128,"call","InsertNewReceiptLine",3],[129,"event","OnAfterInsertNewReceiptLine",0],[132,"ext","codeunit",7320,"UndoPostedWhseRcptLine",1],[134,"call","UpdateOrderLine",1],[136,"ext","codeunit",7320,"UpdateRcptSourceDocLines",1],[139,"call","UpdateBlanketOrder",1],[146,"event","OnBeforePurchRcptLineModify",0],[147,"write",121,"Modify"],[148,"event","OnAfterPurchRcptLineModify",0],[155,"event","OnCodeOnBeforeMakeInventoryAdjustment",0],[156,"call","MakeInventoryAdjustment",0],[158,"ext","codeunit",7320,"PostTempWhseJnlLine",1],[160,"event","OnAfterCode",0]]},{"name":"CheckPurchRcptLines","line":163,"kind":"procedure","access":"local","params":2,"steps":[[168,"event","OnBeforeCheckPurchRcptLines",1],[174,"event","OnCheckPurchRcptLinesAfterPurchRcptLineSetFilters",0],[182,"call","CheckPurchRcptLine",1]]},{"name":"CheckPurchRcptLine","line":186,"kind":"procedure","access":"local","params":1,"steps":[[192,"event","OnBeforeCheckPurchRcptLine",1],[199,"ext","table",121,"IsProdOrder",0],[201,"call","HasInvoicedNotReturnedQuantity",1],[205,"ext","codeunit",5817,"TestPurchRcptLine",1],[207,"event","OnCheckPurchRcptLineOnBeforeCollectItemLedgEntries",1],[209,"ext","table",121,"IsProdOrder",0],[210,"ext","codeunit",5817,"CollectOutputItemLedgEntriesForSubcontructingPurcReceiptLine",2],[211,"ext","codeunit",5817,"CheckItemLedgEntries",3],[215,"ext","codeunit",5817,"CollectItemLedgEntries",6],[217,"ext","codeunit",5817,"CheckItemLedgEntries",3]]},{"name":"GetCorrectionLineNo","line":222,"kind":"procedure","access":"local","params":1,"steps":[[229,"event","OnBeforeGetCorrectionLineNo",1]]},{"name":"PostItemJnlLine","line":247,"kind":"procedure","access":"local","params":2,"steps":[[266,"event","OnBeforePostItemJnlLine",1],[273,"call","GetCorrectionLineNo",1],[314,"ext","table",121,"IsProdOrder",0],[315,"event","OnUpdateItemJnlLineProdOrderSubcontracting",0],[318,"event","OnAfterCopyItemJnlLineFromPurchRcpt",1],[322,"ext","codeunit",7320,"InsertTempWhseJnlLine",8],[325,"event","OnPostItemJnlLineOnAfterInsertTempWhseJnlLine",0],[329,"ext","codeunit",5817,"TransferSourceValues",2],[332,"event","OnPostItemJnlLineOnBeforeUndoPosting",1],[336,"ext","codeunit",5817,"PostItemJnlLine",1],[339,"event","OnPostItemJnlLineOnBeforeUndoValuePostingWithJob",1],[349,"ext","table",339,"GetInboundEntriesTheOutbndEntryAppliedTo",1],[351,"ext","table",339,"GetOutboundEntriesAppliedToTheInboundEntry",1],[354,"ext","codeunit",5817,"FindItemReceiptApplication",2],[355,"ext","codeunit",22,"UndoValuePostingWithJob",2],[358,"event","OnPostItemJournalInboundItemEntryPostingWithJob",1],[360,"ext","codeunit",5817,"FindItemShipmentApplication",2],[361,"ext","codeunit",22,"UndoValuePostingWithJob",2],[365,"ext","codeunit",5817,"ReapplyJobConsumption",1],[372,"ext","table",121,"IsProdOrder",0],[373,"ext","codeunit",5817,"CollectItemLedgEntries",6],[376,"ext","table",121,"IsProdOrder",0],[377,"ext","codeunit",5402,"CalcBaseQty",6],[380,"event","OnPostItemJnlLineOnAfterCollectItemLedgEntries",1],[385,"call","ReapplyJobConsumptionFromApplyToEntryList",4],[388,"ext","codeunit",5817,"PostItemJnlLine",1],[390,"ext","codeunit",5817,"PostItemJnlLineAppliedToList",7]]},{"name":"ReapplyJobConsumptionFromApplyToEntryList","line":396,"kind":"procedure","access":"local","params":4,"steps":[[403,"event","OnBeforeReapplyJobConsumptionFromApplyToEntryList",1],[411,"ext","codeunit",5801,"FindAppliedEntries",2],[414,"ext","codeunit",5817,"ReapplyJobConsumption",1],[417,"ext","codeunit",5817,"ReapplyJobConsumption",1]]},{"name":"InsertNewReceiptLine","line":421,"kind":"procedure","access":"local","params":3,"steps":[[438,"event","OnBeforeNewPurchRcptLineInsert",0],[439,"write",121,"Insert"],[441,"event","OnAfterNewPurchRcptLineInsert",0],[443,"call","InsertItemEntryRelation",2]]},{"name":"UpdateOrderLine","line":446,"kind":"procedure","params":1,"steps":[[452,"event","OnBeforeUpdateOrderLine",1],[457,"event","OnUpdateOrderLineOnBeforeUpdatePurchLine",0],[458,"ext","codeunit",5817,"UpdatePurchLine",4],[459,"ext","codeunit",5817,"UpdatePurchaseLineOverRcptQty",2],[460,"event","OnAfterUpdateOrderLine",0]]},{"name":"UpdateBlanketOrder","line":463,"kind":"procedure","params":1,"steps":[[469,"event","OnBeforeUpdateBlanketOrder",1],[486,"ext","codeunit",5402,"QtyRndPrecision",0],[489,"event","OnBeforeBlanketOrderInitOutstanding",0],[490,"ext","table",39,"InitOutstanding",0],[491,"write",39,"Modify"]]},{"name":"InsertItemEntryRelation","line":495,"kind":"procedure","access":"local","params":2,"steps":[[502,"ext","table",6507,"TransferFieldsPurchRcptLine",1],[503,"write",6507,"Insert"]]},{"name":"HasInvoicedNotReturnedQuantity","line":507,"kind":"procedure","params":1,"steps":[[526,"ext","table",339,"AppliedOutbndEntryExists",3],[530,"call","IsCancelled",1]]},{"name":"MakeInventoryAdjustment","line":575,"kind":"procedure","access":"local","params":0,"steps":[[579,"ext","codeunit",5894,"SetJobUpdateProperties",1],[580,"ext","codeunit",5894,"MakeAutomaticInventoryAdjustment",1]]},{"name":"OnSetItemAdjmtPropertiesOnBeforeCheckModifyItem","line":584,"kind":"procedure","access":"local","params":1,"steps":[[588,"ext","table",313,"UseLegacyPosting",0]]},{"name":"UndoDropShipmentPurchRcptLine","line":595,"kind":"procedure","access":"local","params":1,"steps":[[606,"call","FindSalesShipmentLine",2],[608,"ext","codeunit",5815,"SetHideDialog",1],[609,"ext","codeunit",5815,"SetCalledFromUndoPurchaseReceiptLine",1],[610,"run","codeunit",5815]]},{"name":"FindSalesShipmentLine","line":613,"kind":"procedure","access":"local","params":2,"steps":[[644,"call","FindSalesShipmentLineByDropShipmentLink",2]]}]}