Microsoft Solution Partner · Vancouver, Canada1-845-200-3742  ·  info@gem365.ca

AI Autofiller & Auditor for Dynamics 365 Business Central

Help & documentation

How to set up the extension, read a document with Azure AI, audit it against your records, and let it fill the purchase or sales document for you.

Requirements

  • Dynamics 365 Business Central online, Essentials or Premium. Released Production Order features require Premium.
  • An Azure subscription with at least one of:
    • an Azure AI Document Intelligence resource, or
    • an Azure AI Content Understanding resource
  • An Azure OpenAI deployment (for example a GPT-4-class model) if you want the Comparison feature and AI-based party matching or account suggestions.
  • A configured Job Queue if you want background extraction.
  • A user with SUPER or equivalent setup permissions to complete the initial configuration.

You pay Microsoft directly for Azure usage. Gem365 does not sit in the data path and does not resell Azure.

Install

  1. Open the extension on Microsoft AppSource and choose Get it now, or in Business Central open Extension Marketplace and search for "AI Autofiller & Auditor".
  2. Select the environment and confirm. Installation takes a few minutes.
  3. When it finishes, search for AI Autofill Setup from the Tell Me search (Alt+Q).
Install in a sandbox first. A sandbox copy of production is the fastest way to test extraction against your real supplier documents without any risk.

Setup card

Everything lives on one page: AI Autofill Setup. It has four areas.

General

FieldWhat it does
ConsentMust be switched on before any content is sent to Azure. Until it is, upload works but extraction and comparison are blocked.
Extract modeOff: extraction only when a user runs it manually. Foreground: runs immediately with a progress dialog. Background: hands the file to the Job Queue.
TimeoutSeconds to wait in Foreground mode before giving up. Large multi-page files may need a higher value.
Reuse stored resultsWhen a file with the same name, size, entity and sub type is uploaded again, offer the stored result instead of calling Azure. In Background mode the stored result is reused without asking.

Azure OpenAI

Endpoint, deployment name, API version and API key for the model that judges equivalence, matches parties as a last resort and suggests G/L accounts. The key is written to Isolated Storage and is never shown again; the field displays only whether a key is set.

Default extraction endpoint

The engine (Document Intelligence or Content Understanding), endpoint, model or analyzer, API version and API key used when no override applies.

Override lines

One line per entity and sub type combination that needs its own settings. Entities are Purchase, Sales, Vendor, Customer and Released Production Order. Sub types are yours to define: Invoice, Bill of Lading, Quote, Manifest, Proof of Delivery and so on. Each line can carry its own endpoint, model, API key, prompt and compare template. Anything left empty falls back to the entity's settings, then to the default.

Two actions on the card help with first-time setup: Load Default creates a sensible starting configuration, and Clear all removes every setting and every stored key.

Feature switches

Comparison, Auto Fill Simple and Auto Fill Advanced each have their own switch. Turning one off removes its FactBox parts and actions from every page, so you can roll out one feature at a time.

Azure configuration

  1. In the Azure portal, create a Document Intelligence or Content Understanding resource in the region you want your documents processed in. Copy its endpoint and one of its keys.
  2. For Document Intelligence, use the prebuilt prebuilt-invoice model as a starting point, or the ID of a custom model you trained on your own documents. For Content Understanding, use the analyzer ID you created.
  3. Create an Azure OpenAI resource and deploy a chat model. Copy the endpoint, deployment name and key.
  4. Enter these values on the setup card. Use Test connection on each section to confirm Business Central can reach the resource.

The API version fields accept any version Microsoft publishes for that service, so you can move to a newer version without waiting for an extension update.

Permissions

The extension ships two permission sets:

  • AI AUTOFILL SETUP: manage the setup card, override lines, keys, compare templates and fill preferences.
  • AI AUTOFILL USER: upload attachments, run extraction and comparison, review and apply proposals.

Assign the user set to everyone who processes documents and the setup set only to administrators.

Upload and extract

  1. Open a purchase or sales document, a Vendor or Customer card, or a Released Production Order. The AI Attachment Audit FactBox is on the right. It works even on a record that has not been saved yet.
  2. Choose Upload and pick one or more files. For each file a dialog asks for the sub type and shows the file name so you know which one it is asking about.
  3. What happens next depends on the extract mode:
    • Foreground: a progress dialog appears and the result is available when it closes.
    • Background: the attachment shows a Queued status. A notification appears the moment the job finishes; no refresh needed. If it fails, the reason is stored on the attachment and the job can be retried from the standard Job Queue Entries page.
    • Off: select the attachment and choose Extract.

If you upload a file that was already extracted (same name, size, entity and sub type), you are offered the stored result and Azure is not called again.

Technical users can open View raw JSON on any attachment to see exactly what Azure returned.

Audit an attachment

Once a file is extracted, choose Compare in the FactBox. The extension compares the record against the attachment in both directions:

  • Header fields: your record's value and the document's value side by side, with a verdict and a confidence score.
  • Document lines: lines only on your record, lines only on the attachment, and lines on both with any differing values highlighted.

The AI judge treats different spellings of the same value ("Net 30 Days" and "30 DAYS") as a match, so reviewers see only real discrepancies. Fields the document does not contain are marked optional rather than mismatched.

Two attachments on the same record, such as an invoice and its bill of lading, are read together as one body of evidence.

Fix from the comparison page

On any mismatched header value choose Accept document value. On a line that exists only on the attachment choose Create line; the picker offers your items, G/L accounts, the party's posting-group accounts and a create-item action. When you are done, Re-run comparison refreshes the result in one click.

Choose what gets compared

Compare templates are defined per sub type on the setup override lines. Pick fields from the full field list of the table, with search. JSON is validated when you save and the message points to the first problem. If a sub type has no template, the extension uses an aggregate of all templates defined for that entity.

Auto Fill

Auto Fill turns an extracted attachment into a full proposal for the document header and lines. Nothing is written until you choose Apply.

Auto Fill Simple

A list, one row per proposed value, with the field, the value read from the document, the value that will be written, and the source. Good for a fast scan of a familiar supplier.

Auto Fill Advanced

A form shaped like the document: a header block and a lines grid, with the original PDF pinned beside it. Every value can be corrected through the normal Business Central picker for that field. Click any value and it is highlighted where it sits on the page; if the value appears more than once, a Match n of m counter cycles through the occurrences. Date format variants are recognised.

How the party is matched

  1. VAT registration number
  2. Exact name
  3. Same words, ignoring spacing and punctuation
  4. The card's short name found inside the printed legal name
  5. AI matching with a confidence score, only if all of the above fail

Party name and number stay in sync in both directions, and name fields such as Pay-to Name take the card's own spelling.

How lines are matched

Printed article numbers and wordings are matched to existing items and to the vendor's or customer's item references. For a line that matches nothing, choose Create item to create it from the line, keeping the printed number as the vendor item reference. When one wording appears on several lines, deciding it once applies to all of them.

Apply

Apply is all-or-nothing: every change is written together or nothing is. Each value passes Business Central's own validation. Re-running Auto Fill on the same document updates existing lines rather than duplicating them, and a line you marked as ignored stays ignored. After apply, each field still shows what the document said and what was chosen.

Line fill models

For lines that do not match an item, the fill model decides what G/L account or type the line gets. Choose it on the Auto Fill form.

ModelBehaviourUse when
As on documentOnly what the attachment itself resolves. Nothing is guessed.You want to see the raw proposal, or your accountant fills accounts by hand.
From historyThe G/L account this party has been posted to most often, read from your posted documents.Established suppliers with a consistent booking pattern.
From account mappingBusiness Central's standard Text-to-Account Mapping rules. Each line finds its own account from the words on it.You already maintain mapping rules, or want deterministic behaviour.
AI suggestionA pick from the party's own candidate accounts, applied only at 70% confidence or above.Mixed invoices from a supplier with several possible accounts.

Aggregate per account is an extra option that folds service-charge lines posting to the same G/L account into a single line carrying their sum. It is reversible, and re-running updates the aggregate line instead of creating a second one.

The Text-to-Account Mappings page is reachable directly from the setup card, since Business Central's own search does not find it.

New from Auto Fill AI

On every purchase and sales list page (Orders, Invoices, Quotes, Returns, Blanket Orders and Credit Memos, for both purchase and sales) there is a New from Auto Fill AI action.

  1. Choose the action and pick a file.
  2. A new document is created, the file is attached and extracted, and the Auto Fill proposal opens.
  3. Review, correct if needed, and choose Apply.
  4. The finished document card opens.

Learned preferences

When you apply a proposal, the fill model and aggregation setting you used become that vendor's or customer's default. The next time you open Auto Fill for the same party, the learned model is preselected and marked with a star.

All learned preferences are listed on the AI Fill Preferences page, where they can be edited or deleted. The FactBox on that page contains a guide to each model. Deleting a preference simply returns that party to the default model.

Where the parts appear

PageAudit FactBoxAuto FillNew from Auto Fill AI
Purchase Order, Invoice, Quote, Return Order, Blanket Order, Credit MemoYesYesOn the list page
Sales Order, Invoice, Quote, Return Order, Blanket Order, Credit MemoYesYesOn the list page
Vendor card, Customer cardYesHeader fields—
Released Production OrderYes——

Troubleshooting

"Consent has not been given"

Open AI Autofill Setup and switch on Consent. Only a user with the setup permission set can do this.

Extraction fails with 401 or 403

The API key is wrong, expired or belongs to a different resource. Re-enter the key on the setup card or the override line and use Test connection. Check that the endpoint URL matches the resource the key belongs to.

Extraction fails with 404

The model, analyzer or deployment name does not exist on that resource, or the API version is not supported by it. Verify the name in the Azure portal.

Foreground extraction times out

Increase the Timeout on the setup card, or switch to Background mode for large files.

Background job stays Queued

Open Job Queue Entries and confirm the AI Autofill job is present and its status is Ready, not On Hold or Error. If it errored, the error text is on the job queue entry and on the attachment.

Comparison marks everything as mismatched

Usually a compare template that lists fields the document does not carry, or an Azure OpenAI deployment that is not reachable. Check the template JSON on the override line and Test connection on the Azure OpenAI section.

Party not matched

Confirm the VAT registration number on the vendor or customer card, or add the printed name to the card's Search Name. AI matching is used only when the four deterministic stages fail, and only if Azure OpenAI is configured.

Apply fails

Apply runs Business Central's normal validation. The message names the field that failed; correct it on the form and apply again. Because apply is all-or-nothing, a failed apply writes nothing.

FAQ

Does my data go through Gem365?

No. Documents go from your Business Central environment directly to your own Azure resources. See the privacy policy.

Which file formats are supported?

PDF, and the image formats accepted by the Azure engine you configured (typically JPEG, PNG and TIFF). Scanned PDFs are handled by the engine's built-in OCR.

Can I use a custom-trained Document Intelligence model?

Yes. Enter the custom model ID on the override line for that sub type.

Does it post anything automatically?

No. It creates and fills documents only when a user applies a proposal, and posting is always a separate, manual step.

Can I turn features on for a pilot group only?

Use the three feature switches to enable only what you need, and assign the AI AUTOFILL USER permission set only to the pilot users.

What happens if I uninstall?

The extension's pages, actions, configuration and stored keys are removed. Values already written to standard purchase and sales documents remain, because they are ordinary Business Central data.

Support

Email info@gem365.ca with your Business Central version, the extension version (from Extension Management), and, for extraction problems, the error text from the attachment. Screenshots help. For a guided demo on one of your own invoices, use gem365.ca/contact-gem365.