---
id: object/codeunit/6196
type: object
title: Codeunit 6196 "E-Doc. PO Matching"
summary: Codeunit 6196 "E-Doc. PO Matching" in EDocument (Microsoft.eServices.EDocument.Processing.Import.Purchase). 24 public procedures. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - edocument
versions:
  introduced: "29"
  last_changed: null
  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: 2ffaeb671e88447f9560b1db76fd50f82a76570fd79515a66583b1efa0920ae7
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/EDocument/app/src/Processing/Import/Purchase/PurchaseOrderMatching/EDocPOMatching.Codeunit.al
    title: src/Apps/W1/EDocument/app/src/Processing/Import/Purchase/PurchaseOrderMatching/EDocPOMatching.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/11815
    - change/bcapps/10700
    - change/bcapps/10526
object_type: codeunit
object_id: 6196
name: E-Doc. PO Matching
namespace: Microsoft.eServices.EDocument.Processing.Import.Purchase
app: EDocument
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 38
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 0
  called_by: 0
  implements: 0
---

# Codeunit 6196 "E-Doc. PO Matching"

> Codeunit 6196 "E-Doc. PO Matching" in EDocument (Microsoft.eServices.EDocument.Processing.Import.Purchase). 24 public procedures. Introduced in BC29, still in BC30.

EDocument · Microsoft.eServices.EDocument.Processing.Import.Purchase · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/EDocument/app/src/Processing/Import/Purchase/PurchaseOrderMatching/EDocPOMatching.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Internal |

## Procedures

- `LoadAvailablePOLinesForEDocumentLine(EDocumentPurchaseLine: Record "E-Document Purchase Line"; var TempPurchaseLine: Record "Purchase Line" temporary)`: Loads all purchase order lines that can be matched to the specified E-Document line into the specified temporary Purchase Line record. A line can be matched if it belongs to an order for the same vendor as the E-Document line, and if it is not already matched to another E-Document line. Lines that a...
- `LoadPOLinesMatchedToEDocumentLine(EDocumentPurchaseLine: Record "E-Document Purchase Line"; var TempPurchaseLine: Record "Purchase Line" temporary)`: Loads all purchase order lines that are matched to the specified E-Document line into the specified temporary Purchase Line record.
- `LoadPOsMatchedToEDocumentLine(EDocumentPurchaseLine: Record "E-Document Purchase Line"; var TempPurchaseHeader: Record "Purchase Header" temporary)`: Loads all purchase orders that are matched to the specified E-Document line into the specified temporary Purchase Header record.
- `LoadAvailableReceiptLinesForEDocumentLine(EDocumentPurchaseLine: Record "E-Document Purchase Line"; var TempPurchaseReceiptLine: Record "Purch. Rcpt. Line" temporary)`: Loads all purchase receipt lines that are matched to purchase order lines that are matched to the specified E-Document line into the specified temporary Purch. Rcpt. Line record.
- `LoadReceiptsMatchedToEDocumentLine(EDocumentPurchaseLine: Record "E-Document Purchase Line"; var TempPurchaseReceiptHeader: Record "Purch. Rcpt. Header" temporary)`: Loads all purchase receipt headers that are matched to the specified E-Document line into the specified temporary Purch. Rcpt. Header record.
- `LoadReceiptLinesMatchedToEDocumentLine(EDocumentPurchaseLine: Record "E-Document Purchase Line"; var TempPurchaseReceiptLine: Record "Purch. Rcpt. Line" temporary)`
- `CalculatePOMatchWarnings(EDocumentPurchaseHeader: Record "E-Document Purchase Header"; var POMatchWarnings: Record "E-Doc PO Match Warning" temporary)`: Calculates warnings for the specified E-Document, and loads them into the specified temporary "E-Doc PO Match Warnings" record.
- `IsPOMatchConsistent(EDocumentPurchaseHeader: Record "E-Document Purchase Header"): Boolean`: Validates that the matches between the E-Document, PO lines and receipt lines are still valid.
- `IsEDocumentLineMatchedToAnyPOLine(EDocumentPurchaseLine: Record "E-Document Purchase Line"): Boolean`: Returns true if the specified E-Document line is matched to any purchase order line.
- `IsEDocumentMatchedToAnyPOLine(EDocumentPurchaseHeader: Record "E-Document Purchase Header"): Boolean`: Returns true if any line in the specified E-Document is matched to any purchase order line.
- `IsPOLineMatchedToEDocumentLine(PurchaseLine: Record "Purchase Line"; EDocumentPurchaseLine: Record "E-Document Purchase Line"): Boolean`: Returns true if the specified purchase order line is matched to the specified E-Document line.
- `IsEDocumentLineMatchedToAnyReceiptLine(EDocumentPurchaseLine: Record "E-Document Purchase Line"): Boolean`: Checks if the specified E-Document line is matched to any receipt line.
- `IsReceiptLineMatchedToEDocumentLine(ReceiptLine: Record "Purch. Rcpt. Line"; EDocumentPurchaseLine: Record "E-Document Purchase Line"): Boolean`: Returns true if the specified receipt line is matched to the specified E-Document line.
- `RemoveAllReceiptMatchesForEDocumentLine(EDocumentPurchaseLine: Record "E-Document Purchase Line")`: Removes all receipt line matches for the specified E-Document line.
- `RemoveAllMatchesForEDocumentLine(EDocumentPurchaseLine: Record "E-Document Purchase Line")`: Removes all matches for the specified E-Document line.
- `RemoveAllMatchesForEDocument(EDocumentPurchaseHeader: Record "E-Document Purchase Header")`: Removes all matches for all lines in the specified E-Document.
- `MatchPOLinesToEDocumentLine(var SelectedPOLines: Record "Purchase Line" temporary; EDocumentPurchaseLine: Record "E-Document Purchase Line")`: Matches the specified purchase order lines to the specified E-Document line. Each purchase order line must belong to an order for the same vendor as the E-Document line, and must not already be matched to another E-Document line. Existing matches are removed, and the E-Document line's purchase type ...
- `MatchReceiptLinesToEDocumentLine(var SelectedReceiptLines: Record "Purch. Rcpt. Line" temporary; EDocumentPurchaseLine: Record "E-Document Purchase Line")`: Matches the specified purchase receipt lines to the specified E-Document line. Each receipt line must be matched to a purchase order line that is matched to the specified E-Document line. Existing matches are removed. If the receipt lines can't cover the full quantity of the E-Document line, the pro...
- `ConfigureDefaultPOMatchingSettings()`
- `ConfigurePOMatchingSettings(DesiredGlobalSetup: Record "E-Doc. PO Matching Setup"; Configuration: Enum "E-Doc. PO M. Configuration"; VendorNos: List of [Code[20]])`: Stores the configuration selected by the user.
- `TransferPOMatchesFromEDocumentToInvoice(EDocument: Record "E-Document")`: Transfer PO matches defined in the e-document to the created purchase invoice
- `TransferPOMatchesFromInvoiceToEDocument(PurchaseHeader: Record "Purchase Header")`: Transfer PO matches defined in the purchase invoice to the linked e-document
- `GetPOMatchingSettings(var GlobalSetup: Record "E-Doc. PO Matching Setup"; var Configuration: Enum "E-Doc. PO M. Configuration"; var VendorNos: List of [Code[20]])`: Loads the settings for purchase order matching.
- `VerifyEDocumentMatchedLinesAreValidMatches(EDocumentPurchaseHeader: Record "E-Document Purchase Header"): Boolean`: Verifies that all E-Document lines that have a Not Yet Received warning can be validly matched without receipt.

Plus 14 local procedures.

## Recent changes

- 2026-09-24 [#11815 Improvements to E-Documents PO matching (E2E findings)](../../changes/bcapps/11815.md) (main, BC30, fix)
- 2026-09-01 [#10700 29.x: PO matching API, E-Documents integration and receipt-on-invoice line tracking](../../changes/bcapps/10700.md) (releases/29.x, BC29, feature)
- 2026-08-28 [#10526 Use BaseApp's new PO Matching module in E-Documents](../../changes/bcapps/10526.md) (main, BC30, feature)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

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). 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: "E-Doc. PO Matching")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
