{"title":"Codeunit 5816 Undo Return Receipt Line, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/5816-undo-return-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":5816,"name":"Undo Return Receipt Line","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/5816-undo-return-receipt-line/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/5816-undo-return-receipt-line/source/","path":"src/Layers/W1/BaseApp/Sales/History/UndoReturnReceiptLine.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:37":{"name":"Sales Line","url":"https://jonas-paprotka.de/ref/table/37-sales-line/"},"table:6661":{"name":"Return Receipt Line","url":"https://jonas-paprotka.de/ref/table/6661-return-receipt-line/"},"codeunit:5817":{"name":"Undo Posting Management","url":"https://jonas-paprotka.de/ref/codeunit/5817-undo-posting-management/"},"codeunit:22":{"name":"Item Jnl.-Post Line","url":"https://jonas-paprotka.de/ref/codeunit/22-item-jnl-post-line/"},"table:339":{"name":"Item Application Entry","url":"https://jonas-paprotka.de/ref/table/339-item-application-entry/"},"table:337":{"name":"Reservation Entry","url":"https://jonas-paprotka.de/ref/table/337-reservation-entry/"},"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/"}},"procs":[{"name":"OnRun","line":33,"kind":"trigger","steps":[[40,"event","OnBeforeOnRun",1],[49,"call","Code",0]]},{"name":"Code","line":84,"kind":"procedure","access":"local","params":0,"steps":[[95,"event","OnBeforeCode",1],[107,"event","OnCodeOnBeforeCallCheckReturnRcptLine",0],[108,"call","CheckReturnRcptLine",1],[116,"write",32,"DeleteAll"],[119,"write",6507,"DeleteAll"],[126,"ext","codeunit",7320,"FindPostedWhseRcptLine",7],[131,"call","PostItemJnlLine",2],[133,"call","GetCorrectionLineNo",1],[135,"call","InsertNewReceiptLine",3],[138,"event","OnAfterInsertNewReceiptLine",1],[145,"write",37,"Modify"],[149,"ext","codeunit",7320,"UndoPostedWhseRcptLine",1],[151,"call","UpdateOrderLine",1],[152,"call","UpdateItemTrkgApplFromEntry",1],[156,"ext","codeunit",7320,"UpdateRcptSourceDocLines",1],[163,"event","OnBeforeReturnRcptLineModify",0],[164,"write",6661,"Modify"],[165,"event","OnAfterReturnRcptLineModify",0],[169,"call","MakeInventoryAdjustment",0],[171,"ext","codeunit",7320,"PostTempWhseJnlLine",1],[174,"event","OnAfterCode",0]]},{"name":"CheckReturnRcptLine","line":177,"kind":"procedure","access":"local","params":1,"steps":[[183,"event","OnBeforeCheckReturnRcptLine",1],[191,"event","OnCheckReturnRcptLineOnBeforeCheckReturnQtyRcdNotInvd",1],[197,"ext","codeunit",5817,"TestReturnRcptLine",1],[199,"event","OnCheckReturnRcptLineOnBeforeCollectItemLedgEntries",1],[201,"ext","codeunit",5817,"CollectItemLedgEntries",6],[203,"ext","codeunit",5817,"CheckItemLedgEntries",2]]},{"name":"GetCorrectionLineNo","line":208,"kind":"procedure","access":"local","params":1,"steps":[[215,"event","OnBeforeGetCorrectionLineNo",1]]},{"name":"PostItemJnlLine","line":234,"kind":"procedure","access":"local","params":2,"steps":[[245,"event","OnBeforePostItemJnlLine",1],[249,"call","GetCorrectionLineNo",1],[274,"event","OnAfterCopyItemJnlLineFromReturnRcpt",1],[280,"ext","codeunit",7320,"InsertTempWhseJnlLine",8],[286,"run","codeunit",22],[287,"event","OnPostItemJnlLineOnAfterRunItemJnlPostLine",0],[291,"ext","codeunit",5817,"CollectItemLedgEntries",6],[294,"ext","codeunit",5817,"PostItemJnlLineAppliedToList",6]]},{"name":"InsertNewReceiptLine","line":300,"kind":"procedure","access":"local","params":3,"steps":[[316,"event","OnBeforeNewReturnRcptLineInsert",0],[317,"write",6661,"Insert"],[318,"event","OnAfterNewReturnRcptLineInsert",0],[320,"call","InsertItemEntryRelation",2]]},{"name":"UpdateOrderLine","line":327,"kind":"procedure","params":1,"steps":[[333,"event","OnBeforeUpdateOrderLine",1],[338,"event","OnUpdateOrderLineOnBeforeUpdateSalesLine",0],[339,"ext","codeunit",5817,"UpdateSalesLine",4],[340,"event","OnAfterUpdateSalesLine",0]]},{"name":"InsertItemEntryRelation","line":343,"kind":"procedure","access":"local","params":2,"steps":[[350,"ext","table",6507,"TransferFieldsReturnRcptLine",1],[351,"write",6507,"Insert"]]},{"name":"UpdateItemTrkgApplFromEntry","line":355,"kind":"procedure","access":"local","params":1,"steps":[[360,"ext","table",37,"SetReservationFilters",1],[364,"ext","table",339,"AppliedOutbndEntryExists",3],[366,"write",337,"Modify"]]},{"name":"MakeInventoryAdjustment","line":371,"kind":"procedure","access":"local","params":0,"steps":[[375,"ext","codeunit",5894,"SetJobUpdateProperties",1],[376,"ext","codeunit",5894,"MakeAutomaticInventoryAdjustment",1]]},{"name":"OnSetItemAdjmtPropertiesOnBeforeCheckModifyItem","line":380,"kind":"procedure","access":"local","params":1,"steps":[[384,"ext","table",313,"UseLegacyPosting",0]]}]}