---
id: object/codeunit/99000834
type: object
title: Codeunit 99000834 "Purch. Line-Reserve"
summary: Codeunit 99000834 "Purch. Line-Reserve" in Base Application (Microsoft.Purchases.Document). 27 public procedures, 28 events, 28 event subscribers. Present since at least BC23, still in BC30, changed in BC24-25, BC27-28.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "28"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 6d169417cfffe0c40d4ad0011e2cd23767da56f28f9eac67c1ab16f92b77074f
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Purchases/Document/PurchLineReserve.Codeunit.al
    title: src/Layers/W1/BaseApp/Purchases/Document/PurchLineReserve.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/9783
object_type: codeunit
object_id: 99000834
name: Purch. Line-Reserve
namespace: Microsoft.Purchases.Document
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "27"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 96
  events: 28
  subscribers: 28
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 12
  called_by: 18
  implements: 0
---

# Codeunit 99000834 "Purch. Line-Reserve"

> Codeunit 99000834 "Purch. Line-Reserve" in Base Application (Microsoft.Purchases.Document). 27 public procedures, 28 events, 28 event subscribers. Present since at least BC23, still in BC30, changed in BC24-25, BC27-28.

Base Application · Microsoft.Purchases.Document · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Purchases/Document/PurchLineReserve.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | TableData "Reservation Entry" = rimd |

## Events published

- `OnVerifyChangeOnBeforeHasError(NewPurchLine: Record "Purchase Line"; OldPurchLine: Record "Purchase Line"; var HasError: Boolean; var ShowError: Boolean)` (integration)
- `OnAfterUpdateItemTrackingAfterPosting(var PurchHeader: Record "Purchase Header")` (integration)
- `OnBeforeCreateReservation(var PurchLine: Record "Purchase Line")` (integration)
- `OnBeforeDeleteLine(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeTransferPurchLineToItemJnlLine(var PurchaseLine: Record "Purchase Line"; var ItemJournalLine: Record "Item Journal Line"; TransferQty: Decimal; var CheckApplToItemEntry: Boolean; var Result: Decimal; var IsHandled: Boolean)` (integration)
- `OnBeforeTransferPurchLineToItemJnlLineReservEntry(var OldReservEntry: Record "Reservation Entry"; PurchLine: Record "Purchase Line"; ItemJnlLine: Record "Item Journal Line"; var TransferQty: Decimal; var IsHandled: Boolean)` (integration)
- `OnBeforeRunItemTrackingLinesPage(var ItemTrackingLines: Page "Item Tracking Lines"; var IsHandled: Boolean)` (integration)
- `OnBeforeVerifyQuantity(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; OldPurchaseLine: Record "Purchase Line")` (integration)
- `OnTransferPurchLineToPurchLineOnAfterOldReservEntrySetFilters(var OldPurchLine: record "Purchase Line"; var NewPurchLine: Record "Purchase Line")` (integration)
- `OnTransferPurchLineToItemJnlLineOnBeforeInitRecordSet(var OldReservationEntry: Record "Reservation Entry")` (integration)
- `OnVerifyChangeOnBeforeTestVariantCode(var NewPurchaseLine: Record "Purchase Line"; var OldPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnCallItemTrackingOnBeforeItemTrackingFormRunModal(var PurchLine: Record "Purchase Line"; var ItemTrackingForm: Page "Item Tracking Lines")` (integration)
- `OnRetrieveInvoiceSpecification2OnBeforeInsert(var TempInvoicingSpecification: Record "Tracking Specification" temporary; ReservEntry: Record "Reservation Entry")` (integration)
- `OnUpdateStatisticsOnBeforeCheckSpecialOrder(var PurchLine: Record "Purchase Line")` (integration)
- `OnBeforeAssignForPlanning(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeRetrieveInvoiceSpecification(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; var OK: Boolean; var TempInvoicingSpecification: Record "Tracking Specification" temporary)` (integration)
- `OnBeforeRetrieveInvoiceSpecification2(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnCreateReservationOnBeforeCreateReservEntry(var PurchLine: Record "Purchase Line"; var Quantity: Decimal; var QuantityBase: Decimal; var ForReservEntry: Record "Reservation Entry"; var IsHandled: Boolean; var FromTrackingSpecification: Record "Tracking Specification"; ExpectedReceiptDate: Date; var Description: Text[100]; ShipmentDate: Date)` (integration)
- `OnCallItemTrackingOnAfterCalcShouldProcessDropShipment(var PurchLine: Record "Purchase Line"; var ShouldProcessDropShipment: Boolean; var ItemTrackingLinesPage: Page "Item Tracking Lines")` (integration)
- `OnAfterCreateReservation(var PurchaseLine: Record "Purchase Line")` (integration)
- `OnBeforeCallItemTracking(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnAfterReservQuantity(PurchaseLine: Record "Purchase Line"; var QtyToReserve: Decimal)` (integration)
- `OnBeforeVerifyChange(var NewPurchaseLine: Record "Purchase Line"; var OldPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeAutoReservePurchLine(ReservSummEntryNo: Integer; var RemainingQtyToReserve: Decimal; var RemainingQtyToReserveBase: Decimal; Description: Text[100]; AvailabilityDate: Date; var IsReserved: Boolean; var Search: Text[1]; var NextStep: Integer; CalcReservEntry: Record "Reservation Entry")` (integration)
- `OnAutoReservePurchLineOnBeforeSetQtyToReserveDownToTrackedQuantity(PurchLine: Record "Purchase Line"; CalcReservEntry: Record "Reservation Entry"; var ReservQty: Decimal; var QtyThisLine: Decimal; var QtyThisLineBase: Decimal)` (integration)
- `OnAfterAutoReservePurchLine(var PurchLine: Record "Purchase Line"; ReservSummEntryNo: Integer; var RemainingQtyToReserve: Decimal; var RemainingQtyToReserveBase: Decimal; Description: Text[100]; AvailabilityDate: Date)` (integration)
- `OnSetSourceForReservationOnBeforeUpdateReservation(var ReservEntry: Record "Reservation Entry"; PurchLine: Record "Purchase Line")` (integration, obsolete 27.0)
- `OnAfterInitFromPurchLine(var TrackingSpecification: Record "Tracking Specification"; PurchaseLine: Record "Purchase Line")` (integration)

## Event subscriptions

- OnGetQtyPerUOMFromSourceRecRef subscribes to Page "Reservation" OnGetQtyPerUOMFromSourceRecRef
- ReservationOnSetReservSource subscribes to Page "Reservation" OnSetReservSource
- ReservationOnDrillDownTotalQuantity subscribes to Page "Reservation" OnDrillDownTotalQuantity
- ReservationOnFilterReservEntry subscribes to Page "Reservation" OnFilterReservEntry
- ReservationOnRelatesToEntrySummary subscribes to Page "Reservation" OnAfterRelatesToSummEntry
- ItemLedgerEntryOnDrillDownTotalQuantity subscribes to Codeunit "Item Ledger Entry-Reserve" OnDrillDownTotalQuantity
- OnCreateReservation subscribes to Codeunit "Reservation Management" OnCreateReservation
- OnLookupDocument subscribes to Codeunit "Reservation Management" OnLookupDocument
- OnLookupLine subscribes to Codeunit "Reservation Management" OnLookupLine
- OnFilterReservFor subscribes to Codeunit "Reservation Management" OnFilterReservFor
- OnCalculateRemainingQty subscribes to Codeunit "Reservation Management" OnCalculateRemainingQty
- OnGetSourceRecordValue subscribes to Codeunit "Reservation Management" OnGetSourceRecordValue
- OnUpdateStatistics subscribes to Codeunit "Reservation Management" OnUpdateStatistics
- OnLookupReserved subscribes to Page "Reservation Entries" OnLookupReserved
- OnAfterAutoReserveOneLine subscribes to Codeunit "Reservation Management" OnAfterAutoReserveOneLine
- OnAutoReserveOnBeforeStopReservation subscribes to Codeunit "Reservation Management" OnAutoReserveOnBeforeStopReservation
- OnAutoTrackOnCheckSourceType subscribes to Codeunit "Reservation Management" OnAutoTrackOnCheckSourceType
- OnTestItemType subscribes to Codeunit "Reservation Management" OnTestItemType
- OnIssueActionMessageOnSetSourceTypeFromSKU subscribes to Codeunit "Reservation Management" OnIssueActionMessageOnSetSourceTypeFromSKU
- CheckSourceTypeSubtype subscribes to Codeunit "Create Reserv. Entry" OnCheckSourceTypeSubtype
- OnRevertDateToSourceDate subscribes to Codeunit "Reservation Engine Mgt." OnRevertDateToSourceDate
- OnGetActivePointerFieldsOnBeforeAssignArrayValues subscribes to Codeunit "Reservation Engine Mgt." OnGetActivePointerFieldsOnBeforeAssignArrayValues
- OnAfterCreateText subscribes to Codeunit "Reservation Engine Mgt." OnCreateText
- OnBeforeSummEntryNo subscribes to Table "Reservation Entry" OnAfterSummEntryNo
- ReservationEntryOnUpdateSourceCost subscribes to Table "Reservation Entry" OnUpdateSourceCost
- OrderTrackingManagementOnSetSourceRecord subscribes to Codeunit "OrderTrackingManagement" OnSetSourceRecord
- OnInsertOrderTrackingEntry subscribes to Codeunit "OrderTrackingManagement" OnInsertOrderTrackingEntry
- OnGetSourceShipmentDate subscribes to Table "Tracking Specification" OnGetSourceShipmentDate

## Procedures

- `CreateReservation(var PurchaseLine: Record "Purchase Line"; Description: Text[100]; ExpectedReceiptDate: Date; Quantity: Decimal; QuantityBase: Decimal; ForReservationEntry: Record "Reservation Entry")`
- `CreateReservationSetFrom(TrackingSpecification: Record "Tracking Specification")`
- `ReservQuantity(PurchaseLine: Record "Purchase Line"): Decimal`
- `Caption(PurchaseLine: Record "Purchase Line"): Text`
- `FindReservEntry(PurchaseLine: Record "Purchase Line"; var ReservationEntry: Record "Reservation Entry"): Boolean`
- `GetReservedQtyFromInventory(PurchaseLine: Record "Purchase Line"): Decimal`
- `GetReservedQtyFromInventory(PurchaseHeader: Record "Purchase Header"): Decimal`
- `ReservEntryExist(PurchaseLine: Record "Purchase Line"): Boolean`
- `VerifyChange(var NewPurchaseLine: Record "Purchase Line"; var OldPurchaseLine: Record "Purchase Line")`
- `VerifyQuantity(var NewPurchaseLine: Record "Purchase Line"; var OldPurchaseLine: Record "Purchase Line")`
- `UpdatePlanningFlexibility(var PurchaseLine: Record "Purchase Line")`
- `TransferPurchLineToItemJnlLine(var PurchaseLine: Record "Purchase Line"; var ItemJournalLine: Record "Item Journal Line"; TransferQty: Decimal; var CheckApplToItemEntry: Boolean): Decimal`
- `TransferPurchLineToPurchLine(var OldPurchaseLine: Record "Purchase Line"; var NewPurchaseLine: Record "Purchase Line"; TransferQty: Decimal)`
- `DeleteLineConfirm(var PurchaseLine: Record "Purchase Line"): Boolean`
- `DeleteLine(var PurchaseLine: Record "Purchase Line")`
- `Block(SetBlocked: Boolean)`
- `CallItemTracking(var PurchaseLine: Record "Purchase Line")`
- `CallItemTracking(var PurchaseLine: Record "Purchase Line"; SecondSourceQuantityArray: array[3] of Decimal)`
- `CallItemTracking(var PurchaseLine: Record "Purchase Line"; ItemLedgerEntryFilter: Text)`
- `RetrieveInvoiceSpecification(var PurchaseLine: Record "Purchase Line"; var TempInvoicingTrackingSpecification: Record "Tracking Specification" temporary): Boolean`
- `RetrieveInvoiceSpecification2(var PurchaseLine: Record "Purchase Line"; var TempInvoicingTrackingSpecification: Record "Tracking Specification" temporary): Boolean`
- `DeleteInvoiceSpecFromHeader(PurchaseHeader: Record "Purchase Header")`
- `DeleteInvoiceSpecFromLine(PurchaseLine: Record "Purchase Line")`
- `UpdateItemTrackingAfterPosting(PurchaseHeader: Record "Purchase Header")`
- `SetApplySpecificItemTracking(ApplySpecific: Boolean)`
- `SetOverruleItemTracking(Overrule: Boolean)`
- `InitFromPurchLine(var TransactionSpecification: Record "Tracking Specification"; PurchLine: Record "Purchase Line")`

Plus 13 local procedures.

## Triggers

OnRun

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 99000845 "Reservation Management"](../codeunit/99000845.md) (18 calls: `AutoReservePurchLine → GetAvailabilityFilter`, `AutoReservePurchLine → InsertReservationEntries`, `AutoReservePurchLine → SetQtyToReserveDownToTrackedQuantity`, …)
- [Codeunit 99000830 "Create Reserv. Entry"](../codeunit/99000830.md) (12 calls: `CreateReservation → CreateReservEntry`, `CreateReservation → CreateReservEntryFor`, `CreateReservation → CreateReservEntryFrom`, …)
- [Codeunit 6500 "Item Tracking Management"](../codeunit/6500.md) (4 calls: `CallItemTracking → ComposeRowID`, `DeleteInvoiceSpecFromHeader → DeleteInvoiceSpecFromHeader`, `DeleteInvoiceSpecFromLine → DeleteInvoiceSpecFromLine`, …)
- [Codeunit 99000831 "Reservation Engine Mgt."](../codeunit/99000831.md) (2 calls: `TransferPurchLineToItemJnlLine → InitRecordSet`, `TransferPurchLineToItemJnlLine → NEXTRecord`)
- [Page 518 "Purchase Lines"](../page/518.md) (2 calls: `OnLookupLine → (object)`, `ShowSourceLines → (object)`)
- [Codeunit 5402 "Unit of Measure Management"](../codeunit/5402.md) (1 call: `RetrieveInvoiceSpecification2 → QtyRndPrecision`)
- [Codeunit 99000841 "Item Ledger Entry-Reserve"](../codeunit/99000841.md) (1 call: `ItemLedgerEntryOnDrillDownTotalQuantity → DrillDownTotalQuantity`)
- [Page 49 "Purchase Quote"](../page/49.md) (1 call: `OnLookupDocument → (object)`)
- [Page 50 "Purchase Order"](../page/50.md) (1 call: `OnLookupDocument → (object)`)
- [Page 51 "Purchase Invoice"](../page/51.md) (1 call: `OnLookupDocument → (object)`)
- [Page 52 "Purchase Credit Memo"](../page/52.md) (1 call: `OnLookupDocument → (object)`)
- [Page 6640 "Purchase Return Order"](../page/6640.md) (1 call: `OnLookupDocument → (object)`)

## Called by

- [Table 39 "Purchase Line"](../table/39.md) (6 calls: `BlockDynamicTracking → Block`, `CheckIfPurchaseLineMeetsReservedFromStockSetting → GetReservedQtyFromInventory`, `OnDelete → DeleteLine`, …)
- [Codeunit 90 "Purch.-Post"](../codeunit/90.md) (4 calls: `DeleteAfterPosting → DeleteInvoiceSpecFromHeader`, `InsertTrackingSpecification → UpdateItemTrackingAfterPosting`, `PostItemJnlLine → TransferPurchLineToItemJnlLine`, …)
- [Codeunit 80 "Sales-Post"](../codeunit/80.md) (3 calls: `TransferReservFromPurchLine → SetOverruleItemTracking`, `TransferReservFromPurchLine → TransferPurchLineToItemJnlLine`, `UpdateAssociatedPurchaseOrder → UpdateItemTrackingAfterPosting`)
- [Codeunit 96 "Purch.-Quote to Order"](../codeunit/96.md) (2 calls: `TransferQuoteToOrderLines → TransferPurchLineToPurchLine`, `TransferQuoteToOrderLines → VerifyQuantity`)
- [Codeunit 99000973 "Purch. Availability Mgt."](../codeunit/99000973.md) (2 calls: `TransferFromPurchase → ReservQuantity`, `TransferFromPurchReturn → ReservQuantity`)
- [Page 54 "Purchase Order Subform"](../page/54.md) (2 calls: `OnDeleteRecord → DeleteLine`, `OnDeleteRecord → DeleteLineConfirm`)
- [Page 55 "Purch. Invoice Subform"](../page/55.md) (2 calls: `OnDeleteRecord → DeleteLine`, `OnDeleteRecord → DeleteLineConfirm`)
- [Page 6641 "Purchase Return Order Subform"](../page/6641.md) (2 calls: `OnDeleteRecord → DeleteLine`, `OnDeleteRecord → DeleteLineConfirm`)
- [Page 97 "Purchase Quote Subform"](../page/97.md) (2 calls: `OnDeleteRecord → DeleteLine`, `OnDeleteRecord → DeleteLineConfirm`)
- [Page 98 "Purch. Cr. Memo Subform"](../page/98.md) (2 calls: `OnDeleteRecord → DeleteLine`, `OnDeleteRecord → DeleteLineConfirm`)
- [Table 38 "Purchase Header"](../table/38.md) (2 calls: `GetQtyReservedFromStockState → GetReservedQtyFromInventory`, `UpdatePurchLinesByFieldNo → VerifyChange`)
- [Codeunit 20438 "Qlty. Warehouse Integration"](../codeunit/20438.md) (1 call: `CollectSourceItemTracking → FindReservEntry`)
- [Codeunit 5817 "Undo Posting Management"](../codeunit/5817.md) (1 call: `PurchLineReserveVerifyQuantity → VerifyQuantity`)
- [Codeunit 5826 "Matched Order Line Mgmt."](../codeunit/5826.md) (1 call: `ShowItemTrackingEntriesForPurchaseInvoice → CallItemTracking`)
- [Codeunit 97 "Blanket Purch. Order to Order"](../codeunit/97.md) (1 call: `OnRun → TransferPurchLineToPurchLine`)
- [Codeunit 99000815 "Reservation-Check Date Confl."](../codeunit/99000815.md) (1 call: `PurchLineCheck → FindReservEntry`)
- [Table 7317 "Warehouse Receipt Line"](../table/7317.md) (1 call: `OpenItemTrackingLines → CallItemTracking`)
- [Table 7321 "Warehouse Shipment Line"](../table/7321.md) (1 call: `OpenItemTrackingLines → CallItemTracking`)

## Recent changes

- 2026-07-31 [#9783 [Master] Purchase Return Order Posting Fails for Manually Reserved Lot-Tracked Items with Exact Cost Reversing Mandatory Enabled: "Applies-to Entry must not be filled out when reservations exist in Item Ledger Entry Entry No.='XXX'"](../../changes/bcapps/9783.md) (main, BC30, fix)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-25, BC27-28

## Deprecations

- procedure OnSetSourceForReservationOnBeforeUpdateReservation: Pending 27.0 (#if not CLEAN27), "This event is never raised."

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Purch. Line-Reserve")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
