I am trying to make a report in Power Query that contains the sales order (line) number for each sales invoice line number. I looked through the standard APIs and the legacy web services, but I can't find anything that replicate the /document line tracking/ function that is available for the invoice lines in Business Central. The closest I get is via the Web Services - Pag 526 - Posted Sales Invoice Lines that contains a field called /Document_No_link/, which contains the /Order_No/ after expanding. But that Order_No is actually the Order_No that is contained in Invoice Header. But that field is only filled out if you invoice from the sales order directly, not when you manually create an invoice and add lines linked to a sales order. In other words, the /Order_No/ field in the header is not really that useful. Any pointers would really be appreciated!
Hi, I briefly tested it. Both methods can use the Order No. and Order Line No. fields, but they may not be displayed on the page. You need to add them to Pag 526 - Posted Sales Invoice Lines first, and then publish them to the Web Service. , you should be able to see these two fields.
Test:
If posting from Sales Order:
If using Get Shipment Lines from Sales invoice
Hope this helps.
Thanks.
ZHU
Was this reply helpful?YesNo
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.