community postIntegration & APIscommunity - not Microsoftreviewed - checked by Opus

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

The Sales Invoices API in Business Central aggregates posted and unposted invoices from two source tables. When invoices are missing from the API results, running the API Data Upgrade process from the API Data Upgrade List page resolves the issue by synchronizing the underlying Sales Invoice Entity Aggregate table.

post That NAV Guy

Teddy Herryanto · 2025-05-20 · 162 words · about 1 min

"The API for Sales Invoices is based on the table called Sales Invoice Entity Aggregate."

Key points

  • The Sales Invoices API is built on the Sales Invoice Entity Aggregate table, which combines unposted invoices from Sales Header with posted ones from Sales Invoice Header
  • Missing invoices in the API most likely mean the aggregate table did not update properly
  • Fix: on the API Data Upgrade List page, select SALES INVOICES and choose Schedule Upgrades, which creates a Job Queue Entry
  • Schedule the job queue entry, ideally outside business hours; when it finishes, the missing invoices should appear in the API

Quotes

  • “The API for Sales Invoices is based on the table called Sales Invoice Entity Aggregate.” (Identifies the underlying table structure that powers the Sales Invoices API)
  • “If invoices are missing, the most likely cause is that the Sales Invoice Entity Aggregate table didn’t update properly.” (Pinpoints the root cause of missing invoices in API results)
  • “Go to the API Data Upgrade List page in Business Central. Find the relevant record: SALES INVOICES, and click Schedule Upgrades.” (Provides the specific steps to resolve the issue)

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

Context

  • Features: Sales Invoices API, API Data Upgrade, Job Queue, Posted Sales Invoices, Unposted Sales Invoices

Source: That NAV Guy, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.