Is it possible to retrieve dimensionSetLines for all SalesOrders in one request using Business Central API. Not just retrieve dimensionSetLines for a specific SalesOrder but for all of them.
I wanted to know if this is possible.
Is it possible to retrieve dimensionSetLines for all SalesOrders in one request using Business Central API. Not just retrieve dimensionSetLines for a specific SalesOrder but for all of them.
I wanted to know if this is possible.
You can't retrieve the Dimension Set Lines directly. You have to go through the parent i.e., the Sales Orders.
However you can still retrieve the required data in one API-call with some clever usage of the OData protocol:
$select
to limit the number of fields retrieved for each Sales Order.$expand
to include the Dimension Set Lines in the call to the Sales Orders endpoint.An example of the API call could be as follows (using REST Client in Visual Studio Code):