I set up a query in our Development Environment to query the Sales Invoice Line table and get two columns. I would like to filter on, but not return, the Shipment Date column, so I set that as a Filter.
I then connected this to Web Services (oData) and tried to run a query using this filter:
(ShipmentDate ge datetime'2018-03-01T00:00:00Z' and ShipmentDate le datetime'2018-03-01T23:59:59Z')
Unfortunately it returns the following error:
Type 'NAV.WS_GetSalesInvoiceLinesTotals' does not have a property 'ShipmentDate'.
How can I use oData to filter on that column? Is there some other way to reference it? The query in Development Environment looks like this:
Type | Data Source | Name | Method Type | Method | Group By |
DataItem | Sales Invoice Line | GetSalesInvoiceLinesTotals | |||
Column | No. | ItemNumber | None | (checked) | |
Column | Quantity | Quantity | Totals | Sum | |
Filter | Shipment Date | ShipmentDate |
Thanks in advance!
*This post is locked for comments
It turns out that when you set a column as Filter, Nav adds "_FilterOnly" to the column name. So when you set up your filter, you have to refer to your column as "<ColumnName>_FilterOnly".
In my case this became ShipmentDate_FilterOnly:
(ShipmentDate_FilterOnly ge datetime'2017-06-01T00:00:00Z' and ShipmentDate_FilterOnly le datetime'2018-03-01T23:59:59Z')
Interestingly, Nav returns this column in the result set, populated with bogus data ("0001-01-01T00:00:00" for the date field I'm filtering on).
The problem is not adding the filter, that works fine. The problem is described in my question.
To add a filter to an OData URI, add $filter= to the end of the name of the published web service.
Something like $filter=ShipmentDate ge datetime'2018-03-01T00:00:00Z' and ShipmentDate le datetime'2018-03-01T23:59:59Z'
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156