Skip to content

Configure Document Matching

Last updated: 02.09.2025 • Reading time: ~12 minutes

With Smart Processing, you set up a comprehensive, dynamic document matching system. The configuration is so flexible that almost any matching process can be represented – from the classic 2-/3-way matching for incoming invoices to individual scenarios such as master data assignments or special processes.

This guide describes:

  • how to activate matching in a process template,
  • which global options are available,
  • how to set up the line matching setup step by step,
  • and how to complement additional process logic or replace standard logic with Custom Execution Codeunits.

Prerequisites

  • A process template is available.
  • The relevant document category (with line table) exists.
  • Optional: A standard workflow has been imported to utilize example setups.

Tip

Import a sample workflow at the beginning. There you will find pre-configured setups (e.g., invoice matching) that you can use as a reference.


Activate Document Matching in the Process Template

  1. Open your process template.
  2. Activate the option Activate Document Matching.
  3. After activation, the Matching Setup button appears in the actions, allowing you to switch to the configuration.

Global Matching Options

These options affect all matching setups within the template:

Option Description Recommendation
Automatic Document Matching Automatically performs a match during document processing. The matching status is visible in the draft. Activate if standardized document types (invoice, order) are being processed.
Matching Mandatory Document can only be processed if it is fully matched. Use when error-free data is absolutely required (e.g., invoices).
Skip Creation on Match Specify whether the creation of the document should be skipped if a valid match is found. This only makes sense if the matching setup processes another own process, such as a custom codeunit like "Sales-Quote to Order."

Note

Use Skip Creation on Match only if your codeunit takes over the entire process including validations. Otherwise, you risk incorrect or incomplete documents.


Matching Setup

The Matching Setup is the heart of the matching process. Here, it is defined which lines from the document are matched with which lines in Business Central.

Typical example: 3-way matching for incoming invoices → Purchase Order ↔ Goods Receipt ↔ Invoice.

Important

Matching occurs exclusively at the line level. Header values (e.g., invoice number, date) are not matched.

Step 1: Start

  • Matching Setup Name – unique name, visible later in the process. Not changeable afterwards.
  • Mandatory Matching – determines whether each incoming line must be matched.

Step 2: Matching Table

  • Matching Document Category – determines the document category (including line table).
  • Matching Table Filter (Header Filter) – narrows down target documents.

Example: Invoice contains the reference "123" → Filter on No. = 123. The system immediately finds the matching header and the associated lines.

Filter Options:

  • None – no filter.
  • Search Text – uses fields captured during capture.
  • Template Field – uses values from template fields.
  • Fixed Value – sets a fixed value.
  • Allow Null Value – determines whether empty values are allowed.

Tip

Use unique criteria such as Document Number or External Reference to minimize manual rework.

Step 3: Setup Matching (Display and Matching Fields)

Here you determine which fields are displayed and which are used for matching.

  • Display Fields – assist in manual verification (e.g., quantity, description).
  • Matching Template Fields – link document fields with table columns.

Example:

Field Name Matching Template Field Purpose
Quantity Quantity (from Template) Match invoice quantity with goods receipt

Option: Accept Deviation → Allows deviations that are not considered errors. In combination with the codeunit 5673350 "SIM_DI Update Deviating Fields", such deviations can be automatically corrected. More on this can be found in the section Available Process Codeunits (Simova & Standard).

Step 4: Automation (Auto-Matching)

With this option, the system automatically assigns lines.

  • Table Field Name – column in the target table (e.g., No.).
  • Incoming Line Field – field from the incoming line (e.g., item number).
  • Allow Null Value – allows filtering with empty values.

Best Practice

Filter by unique fields like No.. Example: Incoming Line.No. = Table Line.No. → automatic linking without manual intervention.

Step 5: Custom Execution Process (optional)

Update Header Fields:

With the function "Update Header Fields" in the Matching Profile Setup, you can specify which fields in the header of the matching document should be updated after a successful match. This option extends matching to allow targeted editing or overwriting of header data in addition to line fields.

Field Description
Table Field Name Indicates the name of the target field that will be updated in the matching process.
Field Value Option Determines how the new field value is determined:
Fixed Value – A fixed value is set.
Template Field – The value is taken from another field of the template.
Template Field Specifies the field of the source field whose value should be taken in the case of the Template Field option.
Fixed Field Value If Fixed Value is chosen, this entry defines the fixed value that will be written to the header field.

Note: This configuration allows for automatic adjustment of header data as soon as a document has been successfully matched — for example, to update posting, status, or date fields and thus complete the entire process.

Custom Execution Codeunits:

Define which codeunit is executed after successful matching.

  • Execution Condition – controls when the codeunit runs: • On unique match → only on unique matching. • Always → also with multiple setups.

  • Execution Codeunit – number of the codeunit to be executed.

Important

The status of the matching must be Fully matched, otherwise the processes will not be executed.


Available Process Codeunits (Simova & Standard)

After matching, codeunits can be automatically started. These complement the logic or completely replace it.

Codeunit Description Typical Scenario Example
5673320 "SIM_DI Purch.-Get Receipts" Imports goods receipt lines into the invoice. (Integrate into Process ) 3-way matching (Order ↔ Goods Receipt ↔ Invoice). Invoice with goods receipt: The positions from the goods receipt are transferred to the invoice.
5673321 "SIM_DI Purch.-Get Order" Imports order lines into the invoice. Integrate into Process 2-way matching (Order ↔ Invoice). Incoming invoice without goods receipt: Order lines are transferred.
5673350 "SIM_DI Update Deviating Fields" Updates fields with deviations (when Accept Deviation is active). (Replace Process Logic) Incoming invoice with price/quantity deviation. Deviating quantity in invoice → Codeunit overwrites target data with invoice values.
Example 83 "Sales-Quote to Order" (Standard BC) Converts a sales quote into an order. Replace Process Logic in sales scenarios. Quote document is directly converted into an order.

Practical Examples

Transfer Goods Receipts

  • Document: Incoming Invoice
  • Setup: Order + Goods Receipt
  • Codeunit: 5673320
  • Result: Goods receipt lines are automatically inserted.

Import Order Lines

  • Document: Incoming Invoice without Goods Receipt
  • Codeunit: 5673321
  • Result: Invoice receives the positions from the order.

Handle Deviations

  • Document: Incoming Invoice with Deviating Quantity
  • Setup: Accept Deviation active
  • Codeunit: 5673350
  • Result: Deviation is accepted and target data is updated.

Troubleshooting

  • No hits with filters – Check filter settings (case sensitivity, Allow Null Value).
  • Automatic mapping does not apply – Set Table Field Name and Incoming Line Field to unique values.
  • Execution Process does not run – Check matching status (Fully matched) and ensure that Enable Execution Codeunit is active.

Next Steps