# How to add document OCR to Dynamics AX 2012

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

## Short answer

Scan or receive documents into a watched folder, run OCR and field extraction on your own server, score confidence per field, and stage the result in AX through the vendor invoice register, AIF or import journals. Low-confidence fields go to a person before anything posts.

## System

Microsoft Dynamics AX 2012

## Capability

document-ocr

## Intro

AX 2012 has document handling for attachments but no built-in OCR. AP teams type invoice headers and lines by hand, receiving staff scan packing slips into attachments no one reads, and quality files certificates of conformance as images that cannot be searched.

OCR on its own is not the goal. The value comes from reading the right fields, matching them to open purchase orders and receipts in AX, and giving a reviewer a quick way to confirm or fix. Document variety is the real problem: dozens of supplier layouts, scans at an angle, and part numbers that look like noise.

This page focuses on the AX side of the pipeline: where captured data should land, how to match it, and where thresholds and review fit.

## Use Cases

### Vendor invoice capture

**Description:** Extract vendor, invoice number, date, currency, totals and lines, then stage a pending vendor invoice referencing the PO for the usual match against product receipts.

### Packing slip to product receipt

**Description:** Read the supplier packing slip, find the open PurchLine, and prepare the receipt quantities for the receiving clerk to verify.

### Certificate of conformance filing

**Description:** Read part number, lot and heat number from certs, attach them to the received lot in inventory, and make them searchable by lot.

### Customer PO in PDF

**Description:** Scanned customer POs are read into sales order lines for review, with cross-reference lookup for customer part numbers.

### Drawing and revision indexing

**Description:** Title block fields such as drawing number and revision are read and used to link the file to the released product.

## System Surface

- Vendor invoice register and pending vendor invoice tables and forms (such as VendInvoiceInfoTable and VendInvoiceInfoLine, verify against your release) as the staging target for AP capture.
- AIF document services and inbound ports (file system adapter is common) for creating purchase and sales documents from XML.
- Data import/export framework for bulk loads where AIF is not configured.
- Document management: DocuRef, DocuValue and document types for linking source images or PDFs to records.
- Inventory lot and batch dimensions (InventBatch, InventDim) for tying certificates to received lots, with names varying by release and customization.

## How It Works

### Standardize intake

**Detail:** Route scans and emails to watched folders by document type. Capture at 300 dpi where possible, since scan quality drives accuracy.

### Run OCR and layout analysis

**Detail:** Use an engine that gives text with positions, plus table detection for invoice lines. Run it on your server for sensitive documents.

### Extract and normalize fields

**Detail:** Apply rules for known suppliers and a model for new layouts. Normalize dates, decimal separators and currency codes.

### Match to AX

**Detail:** Look up the vendor by tax ID or name, find the PO by reference, and compare quantities and prices to the open lines and tolerances.

### Score and route

**Detail:** Assign a confidence to each field. Documents with all critical fields above threshold go to quick confirm; others go to full review.

### Stage and attach

**Detail:** Create the pending record through AIF or import, attach the source file, and keep the extraction JSON for audit and tuning.

## Example Flows

### Invoice with PO reference

**Trigger:** An AP clerk scans an invoice into the capture folder.

**Steps:**

- OCR reads the page and extracts header and lines.
- Vendor is matched by tax ID; PO number is matched to PurchTable.
- Line quantities and prices are compared with receipts and tolerance.
- A pending vendor invoice is staged with differences highlighted.
- The clerk approves or edits and submits for the normal workflow.

**Result:** Keying is replaced by verification, and mismatches are visible before posting.

### Certificate of conformance

**Trigger:** A supplier cert arrives with a shipment.

**Steps:**

- OCR reads part number, lot or heat number and spec revision.
- The service matches the part and lot to the received inventory batch.
- The file is attached and a quality task is raised if the lot is not found.

**Result:** Certs are traceable by lot and a missing cert becomes a visible exception instead of an audit finding.

## On Prem

Documents in aerospace, defense and electronics supply chains frequently carry export-controlled or customer-confidential data. Run OCR, layout analysis and any language model on servers in your own network, with the watched folder on a file share and AX reached over AIF or SQL locally. Open-weight vision-language models can handle odd layouts without sending pages to a public API. Keep model versions pinned and re-test accuracy when you upgrade, because a silent change in extraction behavior is an accounting risk.

## Security

- Encrypt the capture share and restrict it to the capture service and named reviewers.
- Retain originals according to your records policy and link them to AX records, not just to the extraction output.
- Validate vendor bank details against the vendor master; flag any change rather than accepting it from a document.
- Log extraction versions, confidences and edits for each document to support audit.
- Isolate the OCR host from the internet if documents are controlled.

## Options

### Commercial AP capture product with AX connector

**Fit:** Invoice-heavy AP departments who want a packaged workflow.

**Effort:** Roughly 6 to 12 weeks with supplier onboarding.

### Open-source OCR plus custom staging code

**Fit:** Teams with developers and a limited set of document types.

**Effort:** Roughly 6 to 10 weeks for one document type.

### Partner build with Netray

**Fit:** Mixed documents including certs and drawings, with on-prem models and review tied to AX.

**Effort:** Scoped after sampling your documents.

## Pitfalls

- Trusting overall accuracy figures instead of measuring per-field accuracy on your own suppliers.
- Line item tables that span pages and get split into separate invoices.
- OCR confusing O and 0 or I and 1 in part numbers, producing valid but wrong items.
- Tax and currency handling differences for multi-entity AX setups.
- Skipping duplicate detection, which lets the same scanned invoice be staged twice.

## Faq

### Does AX 2012 include OCR?

**Answer:** No. AX 2012 stores documents as attachments but does not read them. You add OCR with an external engine and stage the extracted data in AX through AIF, import journals or the vendor invoice register.

### What confidence threshold should I use?

**Answer:** Set it per field from measured results, not a generic number. Totals, invoice number and PO reference deserve stricter thresholds than descriptions. Begin with full review and relax gradually as error rates drop.

### Can this run fully on-prem?

**Answer:** Yes. OCR engines and open-weight document models run on local servers, and the capture folder and AX stay inside your network. This is often required for controlled documents.

### How does it handle scans of poor quality?

**Answer:** It reports low confidence and routes them to review. Improving the source scan quality, deskewing and contrast correction often help more than changing models. Some documents are better requested again in digital form.

### Will it fit with three-way match?

**Answer:** Yes. Staging the invoice against the PO and product receipt lets the standard AX match logic and tolerances apply, and the reviewer sees the differences before the invoice goes through workflow.

## Search terms

dynamics ax document ocr, dynamics ax 2012 invoice ocr, ocr for dynamics ax accounts payable, dynamics ax 2012 vendor invoice capture, automate packing slip dynamics ax, certificate of conformance ocr erp, dynamics ax 2012 invoice automation, on-prem ocr erp manufacturing

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