{"title":"Codeunit 5857 Copy Invt. Document Mgt., extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/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":5857,"name":"Copy Invt. Document Mgt.","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/","path":"src/Layers/W1/BaseApp/Inventory/Document/CopyInvtDocumentMgt.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":{"codeunit:379":{"name":"Transfer Old Ext. Text Lines","url":"https://jonas-paprotka.de/ref/codeunit/379-transfer-old-ext-text-lines/"},"table:5850":{"name":"Invt. Document Header","url":"https://jonas-paprotka.de/ref/table/5850-invt-document-header/"},"table:5851":{"name":"Invt. Document Line","url":"https://jonas-paprotka.de/ref/table/5851-invt-document-line/"},"table:32":{"name":"Item Ledger Entry","url":"https://jonas-paprotka.de/ref/table/32-item-ledger-entry/"},"codeunit:311":{"name":"Item-Check Avail.","url":"https://jonas-paprotka.de/ref/codeunit/311-item-check-avail/"},"table:337":{"name":"Reservation Entry","url":"https://jonas-paprotka.de/ref/table/337-reservation-entry/"},"codeunit:6500":{"name":"Item Tracking Management","url":"https://jonas-paprotka.de/ref/codeunit/6500-item-tracking-management/"}},"procs":[{"name":"CopyItemDoc","line":58,"kind":"procedure","params":3,"steps":[[78,"ext","codeunit",379,"ClearLineNumbers",0],[104,"call","CheckItemAvailable",2],[126,"call","CheckItemAvailable",2],[148,"call","CheckItemAvailable",2],[159,"write",5850,"Insert",1],[170,"write",5851,"DeleteAll",1],[206,"write",5850,"Modify",1],[208,"write",5850,"Modify"],[220,"event","OnCopyItemDocOnBeforeLoopFromInventoryDocumentLine",0],[223,"call","CopyInvtDocLine",7],[231,"event","OnCopyItemDocOnBeforeLoopFromInventoryReceiptLine",0],[235,"call","CopyInvtDocLine",7],[246,"event","OnCopyItemDocOnBeforeLoopFromInventoryShipmentLine",0],[250,"call","CopyInvtDocLine",7]]},{"name":"CopyInvtDocLine","line":262,"kind":"procedure","access":"local","params":7,"steps":[[284,"validate",5851,"Description"],[286,"validate",5851,"Item No."],[287,"validate",5851,"Variant Code"],[288,"validate",5851,"Location Code"],[289,"validate",5851,"Unit of Measure Code"],[290,"validate",5851,"Quantity"],[305,"write",32,"DeleteAll"],[308,"event","OnCopyInvtDocLineOnBeforeCopyItemTrackingAndAppliesValues",1],[312,"call","GetItemLedgEntries",5],[314,"call","GetItemLedgEntries",5],[317,"call","UpdateInvtDocumentLineWithTrackingAndAppliesValue",5],[322,"write",5851,"Insert"],[326,"event","OnAfterCopyInvtDocLine",0]]},{"name":"CheckItemAvailable","line":329,"kind":"procedure","params":2,"steps":[[340,"validate",5851,"Document Date"],[342,"validate",5851,"Document Date"],[344,"ext","codeunit",311,"InvtDocCheckLine",1]]},{"name":"GetItemDocLedgerEntryNo","line":347,"kind":"procedure","params":3,"steps":[[357,"ext","table",32,"TrackingExists",0]]},{"name":"UpdateInvtDocumentLineWithTrackingAndAppliesValue","line":363,"kind":"procedure","access":"local","params":5,"steps":[[380,"ext","table",32,"TrackingExists",0],[381,"call","CopyItemLedgEntryTrkgToInvtDocumentLine",4],[386,"validate",5851,"Applies-from Entry"],[388,"validate",5851,"Applies-to Entry"]]},{"name":"CopyItemLedgEntryTrkgToInvtDocumentLine","line":395,"kind":"procedure","access":"local","params":4,"steps":[[401,"call","GetSignFactor",5],[410,"call","InsertReservEntryForInvtDocumentLine",6]]},{"name":"InsertReservEntryForInvtDocumentLine","line":467,"kind":"procedure","access":"local","params":6,"steps":[[471,"ext","table",32,"TrackingExists",0],[475,"call","InitReservEntry",5],[476,"ext","table",337,"SetSource",6],[487,"ext","table",337,"UpdateItemTracking",0],[488,"write",337,"Insert"]]},{"name":"InitReservEntry","line":491,"kind":"procedure","access":"local","params":5,"steps":[[498,"ext","table",337,"CopyTrackingFromItemLedgEntry",1],[500,"validate",337,"Quantity (Base)"],[505,"ext","codeunit",6500,"ExistingExpirationDate",3]]},{"name":"GetItemLedgEntries","line":513,"kind":"procedure","access":"local","params":5,"steps":[[520,"write",32,"DeleteAll"],[523,"call","FilterPstdDocLineValueEntries",4],[540,"write",32,"Insert"]]}]}