Skip to content

Document Line Matching

Date: 01.06.2026 • Reading time: ~12 minutes

What is Document Matching?

Document Matching is a feature within Smart Processing that automatically or manually links the lines and headers of an incoming document (e.g., a supplier invoice) to existing records in Business Central (e.g., purchase orders).

Why is this useful? Without matching, someone would need to manually search for the correct order for every incoming invoice and compare the individual line items. Document Matching automates this step, saves time, and reduces errors.

What can be matched?

  • Header matching: The document as a whole is assigned to one or more Business Central records (e.g., a purchase order header).
  • Line matching: Each individual line of the incoming document is matched to a specific line in a Business Central record.
  • Multi-header and multi-line matching: Each incoming line can be matched to a different document header simultaneously. This means line 1 of an invoice could belong to order A and line 2 to order B - the system handles both in parallel.

Prerequisite

Document Matching must first be activated in your Smart Processing template. If you see a matching status in the Draft Window, the feature is active. If not, contact your system administrator or refer to Setting up Document Matching.

For pricing information, please refer to our website.


Step 1 – Starting in the Draft Window

The matching process begins when you process an incoming document.

How to get there:

  1. Open the Incoming List in Smart Processing.
  2. Select a document and click Process Document.
  3. The Draft Window opens.

If Document Matching is active, a Status Field appears at the top of the Draft Window. This field shows the current matching status at a glance - it may already be pre-filled if automatic matching ran during document capture.

Understanding the Matching Status

The status tells you exactly what still needs to be done before you can complete processing:

Status Color Meaning What to do
Fully matched 🟢 Green All relevant lines are correctly assigned. Proceed with Complete Processing. Line field updates run automatically if configured.
Partially matched 🟡 Yellow Some lines are assigned, others still need to be checked. Open the Matching Page and match the remaining lines.
Invalid match 🔴 Red One or more assignments are incorrect or contradictory. Open the Matching Page, check and correct the assignments.
Not matched 🔴 Red No assignments have been made yet. Open the Matching Page and start matching.

Matching Mandatory

If Matching Mandatory is enabled in your template, the Complete Processing action will be blocked as long as the status is not Fully matched. A message will appear explaining the reason. You must complete all assignments before you can continue.

Opening the Matching Page

From the Draft Window, you can switch to the Matching Page in two ways:

  • Click directly on the Status Field, or
  • use the Match Document action in the action bar.

Step 2 – Overview of the Matching Page

The Matching Page is your central workspace for reviewing and managing all assignments. It is divided into several areas:

Main Areas

Area Location Purpose
Incoming Lines Top All lines extracted from the document. This is what the AI or OCR read.
Matching Setups Middle Your pre-configured rules per document type or process. Each setup represents one matching scenario.
Detail Panel Right side Additional details about the currently selected incoming line: status, recognized values, any deviations.

Additional Areas

  • Matching To Do: A summary of all open assignments. Lines marked with an asterisk (*) are mandatory and must be matched before processing can continue.
  • Matched Lines: Shows already matched lines side by side with the corresponding Business Central record values. This makes it easy to spot discrepancies between what was captured and what is stored in BC. Each matched line is color-coded to indicate its comparison result:

    Color Meaning
    🟢 Green The captured value matches the BC record value exactly — no action needed.
    🔴 Red There is a deviation — the captured value differs from the BC value. Review and decide whether to accept or correct the discrepancy.
    🟡 Yellow There is a deviation, but it falls within a configured tolerance and is automatically accepted. No manual action required.

Step 3 – Working with the Matching Page

Available Actions Overview

The Matching Page provides actions that fall into two categories: global actions that affect all lines, and line-level actions for individual assignments.


Global Actions

These actions apply to all lines and the overall matching state:

Match Automatically

Starts the automatic matching engine based on your configured rules. The system evaluates all incoming lines against all matching setups and assigns lines where the criteria are met unambiguously.

  • If no lines can be matched automatically, a message is displayed and no changes are saved.
  • After a successful run, check the Matching To Do area for any remaining open assignments.

Reset Matching

Revokes all existing assignments and resets the matching status to Not matched.

When to use Reset Matching

Use this action if your matching rules have changed, if the wrong document was processed, or if you want to start matching from scratch. After resetting, you can run automatic matching again with updated rules.

Edit Template

Opens the process template directly from the Matching Page. Here you can adjust filters, field mappings, or matching rules without leaving the current workflow. Changes take effect immediately for the next matching run.

Refresh Matching Status

Recalculates the matching status for all lines based on the current data in Business Central.

When is this useful?

Business Central data can change between the time a document is captured and the time it is processed (e.g., an order quantity is updated, a record is deleted, or master data changes). Use Refresh Matching Status to re-evaluate whether your existing assignments are still valid after such changes. A confirmation message is shown after the refresh completes.


Special Case: Matching Documents with Multiple Header References

What is a Collective Invoice?

A collective invoice is a single incoming invoice that references multiple orders or deliveries instead of just one. This is common in supplier relationships where multiple orders are bundled into one monthly invoice.

Example: A supplier sends one invoice that covers order 786173 and order 786290. Instead of one order number per line, the invoice header contains a combined reference like:

786173 +786290

or similar formats depending on the supplier.

How Smart Processing Handles This

Business Central uses the | character as an OR filter operator. This means a filter value of 786173|786290 will find all records where the field matches either 786173 or 786290.

Smart Processing can use this filter format to automatically match a document against multiple headers at once - but the captured value must first be in this format.

How to get the value into the correct format:

You have two options, and you can choose whichever fits your setup better:

Option A – During AI extraction (recommended): In the schema of your Content Understanding Analyzer, define a field description that instructs the AI to output order references in the pipe-separated format. For example:

"Extract all referenced order numbers from the document and return them as a pipe-separated list (e.g. 786173|786290). Do not include spaces or other separators."

This way, the AI produces the correct format directly, and no further transformation is needed.

Option B – Via Field Translation in the template: In the relevant template field (e.g., YourReference), configure a Field Translation using a regex rule that replaces the original separator (e.g., +) with |. This approach works when the AI output cannot be controlled directly or when you want to handle the transformation on the Business Central side.

Example Matching Setup for Collective Invoices

The following is one possible example of how you could configure a matching setup for collective invoices. Your actual setup will depend on your document types, field names, and business processes - the exact fields and filters you use may differ.

The key principle is: the filter field that identifies the target header must receive the pipe-separated OR filter value (786173|786290).

An example configuration could look like this:

Setting Example Value Notes
Header Filters Configured as needed for your scenario Use filters that narrow down the search to the right document type/vendor.
Record Filters e.g. Type = Order Optional - set a fixed value if your process always targets one document type.
No. field mapping Mapped to e.g. YourReference This template field should contain the pipe-separated order numbers.
Auto Matching Filter Active Enables automatic evaluation of the OR filter during matching.

This is an example, not a required configuration

The field names, filter values, and structure shown above are illustrative. Depending on your template design, you might use different header fields, different record filter criteria, or a different template field to carry the order references. The important thing is that the field used for the No. mapping receives a valid BC filter value like 786173|786290.

Once the value is correctly formatted and the setup is in place, Smart Processing will search across all matching headers using the OR filter and perform automatic matching - covering all referenced orders in a single pass.

Many references? Use Document Search to avoid field length limits

If your collective invoices reference a large number of orders, the combined filter value (e.g. 786173|786290|786411|...) can quickly exceed the maximum field length of the template field you are using. In that case, instead of mapping the No. field to a template field, use the Document Search option in the Header Matching Filter. This reads the referenced numbers directly from the raw extracted values of the Analyzer - bypassing template field length restrictions entirely and allowing even very long OR-filter chains to be processed correctly.

For detailed information on configuring Header Filters, Record Filters, and the Auto Matching Filter, see Setting up Document Matching.


Manual Matching

When automatic matching cannot find a unique match - for example because reference numbers are missing or ambiguous - you can match lines manually.

Match with Incoming Line

Manually links a selected incoming line with a target line in Business Central.

How it works:

  1. Select the incoming line you want to match.
  2. Browse or search for the correct target line in Business Central.
  3. Use the Match with Incoming Line action to create the assignment.

Matching lines to different headers

Each incoming line can be matched to a different document header. For example, line 1 of an incoming invoice can be assigned to order A and line 2 to order B. The system processes and archives all matched headers independently. This gives you full flexibility when a single incoming document spans multiple target records.

Revoke Match

Removes an existing assignment for a selected line. Use this if:

  • An assignment was made incorrectly (e.g., wrong order matched).
  • Rules have changed and the existing match is no longer valid.
  • You want to re-do the matching for a specific line.

After revoking, the line returns to the Not matched state and can be reassigned manually or via automatic matching.


Matching Documents Without Incoming Lines

Not every document has structured line items. Emails, cover letters, or approval requests often contain only header-level information.

Example: A customer sends an email requesting that quote 1005 be converted into an order. The email has no line items - but the header contains the quote number, which is enough to identify the target document.

For these cases, the Matching Page provides two dedicated actions per matching setup:

Set Matching Record

Manually assigns the currently selected Business Central record as the matching target for a specific matching setup.

When to use: When no incoming lines are available and the target document must be identified from header data alone.

After setting the matching record, Complete Processing can run and trigger the configured process logic (e.g., converting a quote to an order via a process codeunit).

Remove Matching Record

Removes the manually assigned matching record from a setup, allowing you to select a different record or clear the assignment entirely.

Note

If an Auto Matching Filter is configured in the setup, it will still evaluate automatically even for header-only documents. Manual assignment via Set Matching Record is only needed when the auto match does not yield a result or when you want to override it.


Handling Deviations

After matching, some lines may show a status of Unfavorable. This means the matched Business Central record exists, but one or more field values differ from what was captured in the incoming document (e.g., the quantity or price does not match exactly).

Deviation Tolerances

You can configure tolerance thresholds per field in your matching setup. If a deviation is within the defined tolerance (e.g., a price difference of less than 1%), the line is automatically considered acceptable and displayed in yellow in the Matched Lines area — no manual action required. Only deviations that exceed the tolerance are flagged in red and require review. Refer to Setting up Document Matching for details on configuring tolerances.

Accept Deviation

This action resolves a deviation by overwriting the incoming cell value with the value from the matched Business Central record.

After accepting:

  • The incoming line is updated with the BC value.
  • The line matching status is recalculated.
  • The page refreshes to reflect the change.

Use Accept Deviation when a minor discrepancy is acceptable (e.g., a rounding difference) and you want to keep the match valid.

No lines updated error

If you trigger a field update (e.g., via a configured process codeunit) but no deviations have been accepted - or the incoming values are already identical to the BC values - the system will display the following error:

"No Lines have been updated because no deviations were accepted or the incoming values are the same as the existing values."

Make sure to accept at least one deviation before triggering the update action.


Follow this sequence for efficient and reliable document processing:

1. Open the Incoming List
2. Select document → click "Process Document"
3. Draft Window opens → check the Matching Status field
4. Status = Fully matched?
   ├─ YES → proceed directly with "Complete Processing"
   └─ NO  → open the Matching Page (click status or "Match Document")
5. On the Matching Page:
   a. Run "Match Automatically" first
   b. Check "Matching To Do" for remaining open items
   c. Resolve remaining lines manually if needed
   d. Accept deviations where appropriate
   e. Check "Matched Lines" for unexpected discrepancies
6. Return to the Draft Window → status should now be "Fully matched"
7. Start "Complete Processing"

Troubleshooting

Complete Processing is Blocked

Symptom: You click Complete Processing but receive an error or the button is unavailable.

Cause: Matching is configured as mandatory but the status is not yet Fully matched.

Solution:

  1. Open the Matching Page.
  2. Check the Matching To Do area - items with an asterisk (*) are mandatory.
  3. Complete all open assignments (automatically or manually).
  4. If assignments exist but the status is still invalid, use Revoke match on the affected lines, then re-match.
  5. If needed, use Reset Matching and start over.

Assignments are Wrong or Implausible

Symptom: Lines have been matched, but the matched record does not seem correct.

Solution:

  1. Select the affected line and use Revoke match to remove the assignment.
  2. Review the matching rules: check for formatting issues, case sensitivity, or missing leading zeros.
  3. If multiple lines are affected, use Reset Matching to revoke all assignments at once.
  4. Re-run Match Automatically after correcting the rules.

Too Few or No Matches

Symptom: Automatic matching finds no results even though matching records exist in BC.

Checklist:

  • Are all relevant fields correctly captured in the document?
  • Do the captured values exactly match the format used in BC (e.g., date format, number format)?
  • Are the matching filters specific enough - but not overly restrictive?
  • Is the Auto Matching Filter active in the matching setup?
  • If using OR filter values (e.g., for collective invoices): is the value in the correct pipe-separated format?
  • Is the Allow Null Value parameter used selectively and not too broadly?

Tips and Best Practices

Topic Recommendation
Unique identifiers Always prioritize fields that uniquely identify a record: document numbers, external references, delivery note numbers, or partner IDs. Avoid fuzzy fields like names or descriptions as the sole matching criterion.
Automatic matching Set up automatic matching wherever possible. It runs in parallel with draft creation, so the status is often already set when you open the Draft Window.
Rule priority Apply exact matching criteria before fuzzy or partial rules. The more specific a rule, the less risk of false matches.
Iterative improvement After each processing run, review the results. If specific matches repeatedly fail or produce wrong results, adjust the matching rules accordingly.
Line field updates If you need to automatically update specific fields in matched lines (e.g., overwrite a price or quantity), configure the Update Line Fields option in your matching setup. This runs automatically when the status reaches Fully matched.
Collective invoices For invoices referencing multiple orders, ensure the captured value is in pipe-separated BC filter format (786173|786290). Use Document Search for large numbers of references to avoid field length limits.

Further Resources