# How to add document OCR to Dynamics NAV

> Source: https://netray.co/integrations/dynamics-nav-document-ocr
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Integrations

## Short answer

Capture scanned or emailed documents, extract header and line data with an OCR and extraction engine, and create draft purchase invoices or receipts in NAV through Incoming Documents or a published codeunit. Confidence thresholds decide what is auto-filled and what a clerk reviews.

## System

Microsoft Dynamics NAV

## Capability

document-ocr

## Intro

Accounts payable teams on NAV key invoices by hand, match them to receipts and chase mismatches. Receiving clerks file packing slips, and quality teams keep certificates of conformance in folders no one can search. OCR can feed all of these, but the value depends on how well it connects to NAV's matching logic.

NAV 2016 added an Incoming Documents feature and an OCR service setup tied to a hosted provider, so some shops already have a path. If you are on an older build or need local processing, you build around web services instead.

Think of OCR as producing a proposal. The ERP's validation is what makes it safe.

## Use Cases

### Vendor invoice capture

**Description:** Extract vendor, invoice number, dates, tax and lines, then create a Purchase Invoice draft matched to the vendor.

### Three-way match against receipts

**Description:** Compare invoice lines with Purchase Lines and Purchase Receipt Lines, flagging price and quantity variances before posting.

### Packing slips to receipts

**Description:** Read the vendor packing slip, locate the Purchase Order and pre-fill a warehouse receipt for confirmation.

### Certificates of conformance

**Description:** Extract lot, heat or batch numbers and attach the file to the Lot No. Information record for traceability.

### Freight and customs documents

**Description:** Capture carrier invoices and allocate the cost to the right purchase or item charges.

### Legacy archive indexing

**Description:** Index scanned historical documents by vendor and document number so audits can find them.

## System Surface

- Incoming Documents (table 130, available from NAV 2016) and the Incoming Document Attachment table store the source file and can create Purchase Invoices or journal lines from it.
- OCR Service Setup and the OCR service integration in NAV 2016 and 2017 connected to a hosted ReadSoft-based service; check whether your version still supports that provider.
- Published codeunits can create a Purchase Header and Purchase Lines with Validate calls, applying vendor defaults, VAT product posting groups and dimensions.
- Vendor Item No. on the Item Vendor or Item Cross Reference tables help map invoice line text to your items.
- Item Tracking and Lot No. Information are the targets for certificate data in traceable-lot manufacturing.

## How It Works

### Pick the intake channel

**Detail:** Scanner folder, mailbox or portal upload. Normalize everything to PDF or image with a page count.

### Run OCR and layout analysis

**Detail:** Use a local OCR engine plus a layout or language model. Output text, tables and field boxes with confidence per field.

### Classify the document

**Detail:** Invoice, packing slip, certificate, drawing or other. Different types go to different templates and validation.

### Match vendor and purchase order

**Detail:** Match vendor by tax ID, name and bank account. Find the PO by reference number, with fallbacks to open lines by item and quantity.

### Create the NAV draft

**Detail:** Use the Incoming Documents path or a codeunit that creates a draft Purchase Invoice with validated fields and the source file attached.

### Apply confidence thresholds

**Detail:** Auto-fill high-confidence fields, highlight low-confidence ones and show the cropped image beside each for the reviewer.

### Learn from corrections

**Detail:** Store reviewer fixes keyed by vendor to improve the extraction templates and rules over time.

## Example Flows

### Vendor invoice to draft

**Trigger:** A PDF invoice arrives in the AP mailbox.

**Steps:**

- OCR extracts header and lines.
- Vendor is matched by tax ID.
- The invoice is matched to PO 104523 lines.
- A draft Purchase Invoice is created with the PDF attached.
- The clerk reviews flagged fields and posts.

**Result:** Keying time falls and variances are visible before posting.

### Certificate attached to lot

**Trigger:** A receiving clerk scans a mill certificate.

**Steps:**

- Classifier marks it as a certificate.
- Heat and lot numbers are extracted.
- The receipt line is located by PO and item.
- The file is attached to the lot record after confirmation.

**Result:** Traceability documents are findable by lot.

### Price variance catch

**Trigger:** An invoice line price differs from the PO.

**Steps:**

- Extraction reads the line price.
- Matching compares it to Direct Unit Cost on the PO line.
- The variance exceeds tolerance.
- The draft is routed to a buyer for approval.

**Result:** Overbilling is caught before it is posted.

## On Prem

Document images often hold pricing and supplier banking details, so many manufacturers want OCR to stay in-house. Run an open OCR engine and a local layout model on a GPU server near NAV, store files on an internal share or in NAV attachments, and call NAV over its internal web services. Avoid hosted OCR if the content is export-controlled or contractually restricted. Size the GPU for your peak batch, usually end-of-month invoices, and keep a manual path for when the model is down.

## Security

- Encrypt document storage and restrict access to AP and receiving roles.
- Verify vendor bank details against the vendor master and flag changes for approval.
- Do not let extraction write directly to posted documents; create drafts only.
- Separate duties so the person who reviews OCR output is not the only approver of payment.
- Retain the original file and extraction result for audit and dispute handling.

## Options

### Native OCR service setup or a marketplace capture add-on

**Fit:** Standard invoices on NAV 2016 or later with a supported provider.

**Effort:** Days to weeks with subscription costs.

### Build an extraction pipeline with an open OCR stack

**Fit:** Varied formats, privacy needs, or older NAV versions.

**Effort:** 6 to 10 weeks for invoices with matching.

### Partner implementation with Netray

**Fit:** Several document types, local models and three-way match logic.

**Effort:** Scoped by document class; pilot with one vendor group.

## Pitfalls

- Accepting OCR output without confidence thresholds creates silent errors in tax and totals.
- Line-level extraction is much harder than header-level; set expectations by document type.
- Multi-page invoices with continuation tables are often split incorrectly.
- Currency, decimal and date formats vary by supplier country and need explicit handling.
- Skipping the PO match makes it hard to catch duplicates and overbilling.

## Faq

### Does Dynamics NAV have built-in OCR?

**Answer:** NAV 2016 and 2017 included an OCR service setup that connected to a hosted provider, alongside Incoming Documents. Availability and support depend on your version and the provider's status today, so confirm before you plan around it.

### Can OCR run fully on-prem?

**Answer:** Yes. Open-source OCR engines and open-weight layout or vision models can run on local servers, with a codeunit creating the NAV drafts. This is common where documents contain controlled data.

### How accurate is invoice OCR?

**Answer:** It varies widely by format and scan quality. Clean digital PDFs extract well; scanned, skewed or handwritten documents do not. Measure on your own invoices and set confidence thresholds from that data.

### Can it do three-way matching?

**Answer:** Yes, if extraction output is compared with Purchase Lines and Purchase Receipt Lines using a custom check. Tolerances for price and quantity should be agreed with finance before you automate.

### What about drawings and certs?

**Answer:** They can be classified and indexed, with key fields like part number, revision, lot and heat extracted. Attach them to the right NAV record after a quick review rather than auto-attaching blindly.

## Search terms

dynamics nav document ocr, navision invoice ocr, dynamics nav incoming documents ocr, nav ocr service setup, dynamics nav invoice capture, navision accounts payable automation, dynamics nav ocr on premises, dynamics nav three way match automation, dynamics nav certificate of conformance capture, navision scan invoices

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
