web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Using a Filter Row with oData

(0) ShareShare
ReportReport
Posted on by 46

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

I have the same question (0)
  • Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    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'

  • MikeWillis Profile Picture
    46 on at

    The problem is not adding the filter, that works fine. The problem is described in my question.

  • Verified answer
    MikeWillis Profile Picture
    46 on at

    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).

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans