odatadynamics-navdynamics-business-central

How to get line items from Business Central Web Service (Odata)?


From Microsoft Documentation, to get salesOrderLines, the following http request is needed:

GET businesscentralPrefix/companies({id})/salesOrders({id})/salesOrderLines({salesOrderLineId})

However, it assumes each json object has a unique GUID. But when I try to get Odata, the only thing close to a unique id I get back is "@odata.etag", and this does not allow me to access the salesOrderLines.

Screenshot


Solution

  • Use /salesOrders?$expand=SalesOrderSalesLines