Hi Community,
I am trying to filter an OData expand query.
You can use the following query as a test sample on any environment with the standard SalesOrderHeaderV2 entity.
https://[BaseURL]/data/
SalesOrderHeadersV2?$expand=SalesOrderLines($filter=LineNum eq 2;$select=SalesId,LineNum,ItemId)
The above URI should essentially return all sales orders and the sales lines with linenum = 2. The returned fields for sales lines should only include SalesId, LineNum and ItemId
Whenever i try to run the above, Dynamics does everything apart from the filter query option inside of the expand.
I have validated the query option syntax.
https://docs.microsoft.com/en-us/dynamics-nav/using-filter-expressions-in-odata-uris
You could refer to the official OData documentation.
Reference.: http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#_Toc31361039