Document OCRMicrosoft Dynamics AX 2012 Agent view

How to add document OCR to Dynamics AX 2012

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.

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.

What teams use it for

Vendor invoice capture

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

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

Certificate of conformance filing

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

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

Drawing and revision indexing

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

Microsoft Dynamics AX 2012 integration 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

  1. 1

    Standardize intake

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

  2. 2

    Run OCR and layout analysis

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

  3. 3

    Extract and normalize fields

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

  4. 4

    Match to AX

    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.

  5. 5

    Score and route

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

  6. 6

    Stage and attach

    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.

  1. OCR reads the page and extracts header and lines.
  2. Vendor is matched by tax ID; PO number is matched to PurchTable.
  3. Line quantities and prices are compared with receipts and tolerance.
  4. A pending vendor invoice is staged with differences highlighted.
  5. 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.

  1. OCR reads part number, lot or heat number and spec revision.
  2. The service matches the part and lot to the received inventory batch.
  3. 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.

Keeping data 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 checklist

  • 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.

Ways to get it done

Commercial AP capture product with AX connector

Effort: Roughly 6 to 12 weeks with supplier onboarding.

Invoice-heavy AP departments who want a packaged workflow.

Open-source OCR plus custom staging code

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

Teams with developers and a limited set of document types.

Partner build with Netray

Effort: Scoped after sampling your documents.

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

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.

Frequently asked questions

Does AX 2012 include OCR?

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?

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?

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?

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?

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.

Want Document OCR working on your Microsoft Dynamics AX 2012?

A free 30 minute assessment: we map the integration path for your version and setup, and where it should run.

Get a free assessment