web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Join purchase invoices to purchase orders

(0) ShareShare
ReportReport
Posted on by 86

I've pulled down all purchase invoices and purchase orders via the standard api's (endpoints purchaseOrders and purchaseInvoices), I used the ?$expand = purchaseOrderLines/purchaseInvoiceLines in order to get the respective lines. Is there a field that joins these two datasets? I can join on vendor,postingDate,itemNumber and variantCode but I'm left with some duplicates. I could identify these and weed them out with some SQL code, however I would suspect that there is a field in BC somewhere that allows me to join these two sets?

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    102,494 Super User 2026 Season 1 on at

    Hi, Could the following blog help you?

    https://www.kauffmann.nl/2021/01/06/batch-calls-with-business-central-apis-3-tips-and-tricks/

    When encountering such complex API processing, a relatively simple way is to create a new table (temporary) in BC, create a new page, and collect all the required data when it is opened. Then access this data in Odata.

    Hope this will help.

    Thanks.

    ZHU

  • garydee Profile Picture
    86 on at

    Thanks ZHU,

    That blog was very useful, will bookmark for sure. It seems that I was mistaken however. There is a field in the purchaseInvoices service called orderNumber which links to the purchase order. I missed it because most of the records for this field are blank! I'm not sure how that could be as I thought there was almost always a purchase order associated with every purchase invoice.

    cheers,

    garydee

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 658 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 499 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 328 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans