---
title: "Codeunit 5857 Copy Invt. Document Mgt., extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/points/
object: https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/
app: "Base Application"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
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/"
---

# Codeunit 5857 Copy Invt. Document Mgt., extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/points/

9 procedures and triggers with a step in src/Layers/W1/BaseApp/Inventory/Document/CopyInvtDocumentMgt.Codeunit.al, in source order, read from the text, not from a run.

## CopyItemDoc

[Line 58](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L58).

- [78](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L78) calls [Codeunit 379 Transfer Old Ext. Text Lines](https://jonas-paprotka.de/ref/codeunit/379-transfer-old-ext-text-lines/) `ClearLineNumbers`
- [104](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L104) calls `CheckItemAvailable`
- [126](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L126) calls `CheckItemAvailable`
- [148](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L148) calls `CheckItemAvailable`
- [159](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L159) writes [Table 5850 Invt. Document Header](https://jonas-paprotka.de/ref/table/5850-invt-document-header/) Insert(true)
- [170](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L170) writes [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) DeleteAll(true)
- [206](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L206) writes [Table 5850 Invt. Document Header](https://jonas-paprotka.de/ref/table/5850-invt-document-header/) Modify(true)
- [208](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L208) writes [Table 5850 Invt. Document Header](https://jonas-paprotka.de/ref/table/5850-invt-document-header/) Modify
- [220](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L220) raises `OnCopyItemDocOnBeforeLoopFromInventoryDocumentLine`
- [223](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L223) calls `CopyInvtDocLine`
- [231](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L231) raises `OnCopyItemDocOnBeforeLoopFromInventoryReceiptLine`
- [235](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L235) calls `CopyInvtDocLine`
- [246](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L246) raises `OnCopyItemDocOnBeforeLoopFromInventoryShipmentLine`
- [250](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L250) calls `CopyInvtDocLine`

## CopyInvtDocLine

[Line 262](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L262), local.

- [284](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L284) validates [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) `Description`
- [286](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L286) validates [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) `Item No.`
- [287](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L287) validates [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) `Variant Code`
- [288](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L288) validates [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) `Location Code`
- [289](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L289) validates [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) `Unit of Measure Code`
- [290](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L290) validates [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) `Quantity`
- [305](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L305) writes [Table 32 Item Ledger Entry](https://jonas-paprotka.de/ref/table/32-item-ledger-entry/) DeleteAll
- [308](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L308) raises `OnCopyInvtDocLineOnBeforeCopyItemTrackingAndAppliesValues`, IsHandled
- [312](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L312) calls `GetItemLedgEntries`
- [314](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L314) calls `GetItemLedgEntries`
- [317](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L317) calls `UpdateInvtDocumentLineWithTrackingAndAppliesValue`
- [322](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L322) writes [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) Insert
- [326](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L326) raises `OnAfterCopyInvtDocLine`

## CheckItemAvailable

[Line 329](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L329).

- [340](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L340) validates [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) `Document Date`
- [342](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L342) validates [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) `Document Date`
- [344](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L344) calls [Codeunit 311 Item-Check Avail.](https://jonas-paprotka.de/ref/codeunit/311-item-check-avail/) `InvtDocCheckLine`

## GetItemDocLedgerEntryNo

[Line 347](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L347).

- [357](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L357) calls [Table 32 Item Ledger Entry](https://jonas-paprotka.de/ref/table/32-item-ledger-entry/) `TrackingExists`

## UpdateInvtDocumentLineWithTrackingAndAppliesValue

[Line 363](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L363), local.

- [380](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L380) calls [Table 32 Item Ledger Entry](https://jonas-paprotka.de/ref/table/32-item-ledger-entry/) `TrackingExists`
- [381](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L381) calls `CopyItemLedgEntryTrkgToInvtDocumentLine`
- [386](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L386) validates [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) `Applies-from Entry`
- [388](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L388) validates [Table 5851 Invt. Document Line](https://jonas-paprotka.de/ref/table/5851-invt-document-line/) `Applies-to Entry`

## CopyItemLedgEntryTrkgToInvtDocumentLine

[Line 395](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L395), local.

- [401](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L401) calls `GetSignFactor`
- [410](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L410) calls `InsertReservEntryForInvtDocumentLine`

## InsertReservEntryForInvtDocumentLine

[Line 467](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L467), local.

- [471](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L471) calls [Table 32 Item Ledger Entry](https://jonas-paprotka.de/ref/table/32-item-ledger-entry/) `TrackingExists`
- [475](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L475) calls `InitReservEntry`
- [476](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L476) calls [Table 337 Reservation Entry](https://jonas-paprotka.de/ref/table/337-reservation-entry/) `SetSource`
- [487](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L487) calls [Table 337 Reservation Entry](https://jonas-paprotka.de/ref/table/337-reservation-entry/) `UpdateItemTracking`
- [488](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L488) writes [Table 337 Reservation Entry](https://jonas-paprotka.de/ref/table/337-reservation-entry/) Insert

## InitReservEntry

[Line 491](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L491), local.

- [498](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L498) calls [Table 337 Reservation Entry](https://jonas-paprotka.de/ref/table/337-reservation-entry/) `CopyTrackingFromItemLedgEntry`
- [500](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L500) validates [Table 337 Reservation Entry](https://jonas-paprotka.de/ref/table/337-reservation-entry/) `Quantity (Base)`
- [505](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L505) calls [Codeunit 6500 Item Tracking Management](https://jonas-paprotka.de/ref/codeunit/6500-item-tracking-management/) `ExistingExpirationDate`

## GetItemLedgEntries

[Line 513](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L513), local.

- [520](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L520) writes [Table 32 Item Ledger Entry](https://jonas-paprotka.de/ref/table/32-item-ledger-entry/) DeleteAll
- [523](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L523) calls `FilterPstdDocLineValueEntries`
- [540](https://jonas-paprotka.de/ref/codeunit/5857-copy-invt-document-mgt/source/#L540) writes [Table 32 Item Ledger Entry](https://jonas-paprotka.de/ref/table/32-item-ledger-entry/) Insert

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
