All case studiesHealthcare services

Automating AP invoice intake in Dynamics NAV 2016: from cloud CSV drops to draft purchase invoices

A healthcare services company on Dynamics NAV 2016 was re-keying the purchase invoices its accounts payable automation platform exports as CSV files to Amazon S3. We built a PowerShell relay to the NAV server and a NAV import whose checked rows become unposted purchase invoices on request, never posted automatically.

2026 (version 5 shipped July 2026) · Dynamics NAV · 3 min read · Published

Industry
Healthcare services
Period
2026 (version 5 shipped July 2026)
Scale
7 NAV objects
12 CSV columns
3 delivery stages
Platform
Dynamics NAV 2016 (C/SIDE, C/AL); Windows PowerShell with AWS CLI; Amazon S3.
Building blocks
Amazon S3Windows PowerShell

The client and the re-keyed invoices

The client is a healthcare services company still running Dynamics NAV 2016. An accounts payable (AP) automation platform exports its purchase invoices as CSV files to an Amazon S3 bucket, and the AP team was keying each of those invoices into NAV a second time, by hand.

The files land in the cloud, but NAV picks up its input from a folder on its own server. So the work has two halves: a relay that brings each file from the bucket to that folder, and NAV objects that import the rows and, as a separate step, turn them into draft purchase invoices. We built both.

From the cloud bucket to the NAV server

  1. ScheduleA Windows scheduled task runs the PowerShell script, and a lock file keeps two runs from overlapping.
  2. DownloadThe script uses the AWS command-line interface (CLI) to download new files from the bucket into a staging folder.
  3. Hand overEach file then moves from staging to the NAV pickup folder. The script checks that both folders are on the same volume, so the move is a rename and NAV never sees a half-copied file.
  4. Mark processedOnce the file is in the pickup folder, the script moves its S3 object to a processed folder in the bucket, so the next run does not download it again.
  5. Log and testEvery run is logged. A local mock test suite runs 17 checks against the script without touching AWS.

Inside NAV

Seven NAV objects handle the rest, two of them modified standard objects. An XMLport reads the 12-column CSV into a buffer table, where each row moves from New to Pending or Error, then on to Processed. Validation runs on these rows before any purchase invoice is created, and the buffer is permanent, so it doubles as the audit trail.

  • Dates and numbers are validated on every row.
  • A duplicate check on vendor and vendor invoice number keeps the same invoice from coming in twice.
  • Rows are grouped into one unposted purchase invoice per vendor invoice, as lines on general ledger accounts, with dimensions.
  • When an invoice is posted, an event subscription writes the posted invoice number back to its buffer rows.
  • Delete actions clear rows in error.
  • A manual upload path takes one-off files.
  • A job-queue report runs the import unattended.

Three different kinds of done

Outcome

Version 5 was delivered in July 2026. With it, a file dropped in the bucket reaches the NAV buffer table unattended, and the checked rows become unposted purchase invoices when someone creates them.

Takeaways

  • Give legacy NAV the same discipline as a Business Central project. This integration runs on NAV 2016, and it still has a lock file, logging, row validation, a duplicate check, and a mock test suite.
  • Keep the raw rows. With the posted invoice number written back to the permanent buffer, each posted invoice can be traced to the CSV rows it came from.

More case studies

Pharmaceutical distribution

Upgrading 1,300 customized objects from Business Central 14 to 27 for a pharmaceutical distributor

Business Central · 5 min read

Food manufacturing

One extension, ten modules: four years of Business Central for a short-shelf-life food manufacturer

Business Central · 4 min read

Get started

Ready to modernize your ERP system?

Talk with JTANG Consulting about your Business Central implementation, upgrade, customization, integration, or support needs. Initial consultations are free, scoped to your business, and never pushy.