D365 Business Central: How to Fix Missing Sales Invoices in the API

Sales Invoices API page

Business Central has many existing APIs that we can use, one of which is the Sales Invoices API. The API for Sales Invoices is based on the table called Sales Invoice Entity Aggregate.

This table consolidates data from:

  • Unposted Sales Invoices (Sales Header)
  • Posted Sales Invoices (Sales Invoice Header)

This API provides a single API endpoint that returns both posted and unposted invoices.

Recently, we had an issue with missing invoices in the API. If invoices are missing, the most likely cause is that the Sales Invoice Entity Aggregate table didn’t update properly. To fix this, we can run the API Data Upgrade process.

Gaps in the Invoices

Go to the API Data Upgrade List page in Business Central. Find the relevant record: SALES INVOICES, and click Schedule Upgrades. This will automatically create a Job Queue Entry for the upgrade.

API Data Upgrade List page
Job Queue API Data Upgrade

Schedule the Job Queue Entry. It’s recommended to run it outside business hours.

Once the job queue is finished, the API should return the missing invoices.

No more missing invoices

thatnavguy

Experienced NZ-based NAV Developer and Consultant with 15+ years of experience leading multiple IT projects, performing business analyst, developing, implementing, and upgrading Dynamics NAV and Business Central. Passionate to deliver solution that focuses on user-friendly interface while keeping high standard of compliance with the needs.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *