Skip to main content

Notifications

Announcements

No record found.

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 44

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

  • Verified answer
    MikeWillis Profile Picture
    44 on at
    RE: Using a Filter Row with oData

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

  • MikeWillis Profile Picture
    44 on at
    RE: Using a Filter Row with oData

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

  • Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Using a Filter Row with oData

    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'

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans