---
title: "Codeunit 6164 E-Doc. Line Matching"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/6164-e-doc-line-matching/
type: codeunit
id: 6164
name: "E-Doc. Line Matching"
app: "E-Document Core"
namespace: Microsoft.eServices.EDocument.OrderMatch
versions: "24-29"
build: 29.0.54011.55644
countries: "W1, DE, US"
source: "https://jonas-paprotka.de/ref/codeunit/6164-e-doc-line-matching/source/?v=28 https://jonas-paprotka.de/ref/codeunit/6164-e-doc-line-matching/source/"
checked: 2026-11-20
changed: 2026-10-14
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 6164 E-Doc. Line Matching

JOP-AL, https://jonas-paprotka.de/ref/codeunit/6164-e-doc-line-matching/

| | |
| --- | --- |
| App | E-Document Core |
| Namespace | Microsoft.eServices.EDocument.OrderMatch |
| Versions | 24-29 |
| Minors | W1 24.0-29.0; DE 24.0-29.0; US 24.0-29.0, [every minor](https://jonas-paprotka.de/ref/codeunit/6164-e-doc-line-matching/editions.json) |
| Access | Internal |
| Source file | src/Processing/OrderMatching/EDocLineMatching.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| RunMatching | (var EDocument: Record "E-Document") | - | public | 24-29 | - | - |
| RunMatching | (var EDocument: Record "E-Document"; WithCopilot: Boolean) | - | public | 24-29 | Pending 29.0 | Deprecated functionality |
| ApplyToPurchaseOrder | (var EDocument: Record "E-Document"; var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary) | - | public | 24-29 | - | - |
| ResetMatchedQty | (var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary) | - | public | 24-29 | - | - |
| UpdateMatchedQty | (var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary; Quantity: Integer) | - | public | 24 | - | - |
| ResetQtyToInvoice | (var TempPurchaseLine: Record "Purchase Line" temporary) | - | public | 24-29 | - | - |
| UpdateQtyToInvoice | (var TempPurchaseLine: Record "Purchase Line" temporary; Quantity: Integer) | - | public | 24 | - | - |
| PersistsUpdates | (var TempEDocMatchesThatWasMatched: Record "E-Doc. Order Match" temporary; RemoveMatch: Boolean) | - | public | 24-29 | - | - |
| ResetQtyToInvoiceBasedOnMatches | (var EDocument: Record "E-Document"; var TempPurchaseLine: Record "Purchase Line" temporary) | - | public | 24-29 | - | - |
| ResetQtyToInvoice | (var EDocument: Record "E-Document") | - | public | 24-29 | - | - |
| RemoveAllMatches | (var EDocument: Record "E-Document") | - | public | 24-29 | - | - |
| FindMatchesToRemove | (var EDocument: Record "E-Document"; var TempPurchaseLine: Record "Purchase Line" temporary; var TempEDocMatchesThatWasRemoved: Record "E-Doc. Order Match" temporary) | - | public | 24-29 | - | - |
| MatchManually | (var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary; var TempPurchaseLine: Record "Purchase Line" temporary; var TempEDocMatchesThatWasMatched: Record "E-Doc. Order Match" temporary) | - | public | 24-29 | - | - |
| AskToOverwrite | (EDocument: Record "E-Document"; var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary; var TempPurchaseLine: Record "Purchase Line" temporary) | - | public | 24-29 | - | - |
| MatchAutomatically | (EDocument: Record "E-Document"; var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary; var TempPurchaseLine: Record "Purchase Line" temporary; var TempEDocMatchesThatWasMatched: Record "E-Doc. Order Match" temporary) | - | public | 24-29 | - | - |
| InsertOrderMatch | (var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary; var TempPurchaseLine: Record "Purchase Line" temporary; var TempEDocMatchesThatWasMatched: Record "E-Doc. Order Match" temporary; Quantity: Integer; FullMatch: Boolean) | - | public | 24 | - | - |
| MatchOneToOne | (var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary; var TempPurchaseLine: Record "Purchase Line" temporary; var TempEDocMatchesThatWasMatched: Record "E-Doc. Order Match" temporary) | - | public | 24-29 | - | - |
| MatchManyToOne | (var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary; var TempPurchaseLine: Record "Purchase Line" temporary; var TempEDocMatchesThatWasMatched: Record "E-Doc. Order Match" temporary) | - | public | 24-29 | - | - |
| MatchOneToMany | (var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary; var TempPurchaseLine: Record "Purchase Line" temporary; var TempEDocMatchesThatWasMatched: Record "E-Doc. Order Match" temporary) | - | public | 24-29 | - | - |
| FilterOutFullyMatchedLines | (var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary; var TempPurchaseLine: Record "Purchase Line" temporary) | - | public | 24-29 | - | - |
| UpdateMatchedQty | (var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary; Quantity: Decimal) | - | public | 25-29 | - | - |
| UpdateQtyToInvoice | (var TempPurchaseLine: Record "Purchase Line" temporary; Quantity: Decimal) | - | public | 25-29 | - | - |
| InsertOrderMatch | (var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary; var TempPurchaseLine: Record "Purchase Line" temporary; var TempEDocMatchesThatWasMatched: Record "E-Doc. Order Match" temporary; Quantity: Decimal; FullMatch: Boolean) | - | public | 25-29 | - | - |
| CreateMatchingRule | (PurchaseLine: Record "Purchase Line"; EDocument: Record "E-Document"; EDocImportedLine: Record "E-Doc. Imported Line") | - | public | 26-29 | - | - |
| CreatePurchaseOrderLine | (EDocument: Record "E-Document"; var TempEDocumentImportedLine: Record "E-Doc. Imported Line" temporary) | - | internal | 26-29 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnBeforeCreateMatchingRule | (var PurchaseLine: Record "Purchase Line"; EDocument: Record "E-Document") | 26-29 | - | - |

## Source

Symbols: Microsoft.E-DocumentCore.symbols.e1d97edc-c239-46b4-8d84-6368bdf67c8b, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-11-20.
AL source 28: https://github.com/microsoft/BCApps, MIT, releases/28.x at 408a4cc8d3a4c54b60464cc14c964479facb9ba0.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
