NAV2013 WebService OData Query - Querying FlowFilter(?)

agomes_17agomes_17 Posts: 9Member
edited 2012-05-28 in NAV Three Tier
Hi there,

I Created a Query Object in new NAV2013 Beta and published it in a web service, like this:



After I publish the Query I can querying like this:

"http://localhost:7048/DynamicsNAV70/OData/Customer" (Example)

and i get the response:



Querying this is easy, My problem is when I try to get a response by applying flowfilter, like this

"http://localhost:7048/DynamicsNAV70/OData/Customer?$filter=No eq '10000'&?$Date_filter_FilterOnly eq datetime '2013-12-31'

(Get the value of Debit Amount in that date)

the response is return with the value of the field without the filter.

Example :

-> return "312529,67" when i expected "291976,4"

Can someone help me?
Sorry for my bad English.
query.jpg 54.2K
response.jpg 134.8K

Comments

  • kinekine Posts: 12,549Member
    I have tried to apply flow filters to Page OData, they are working. On Query, there is some problem, not working for me. There is another difference - on the page, the Date_Filter is of type String, on Query, it is of type DateTime.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • agomes_17agomes_17 Posts: 9Member
    hey, yes in a query the date_filter is datetime, i see in MSDN in that case do "......datetime '2013-12-31' but still doens't work :s

    It's like the filter is never applied.
  • kinekine Posts: 12,549Member
    Have you tried to open the query directly in RTC? Is the result correct?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • agomes_17agomes_17 Posts: 9Member
    Yes i tried that, open the query in RTC and show the result correct, and if i apply the filter manually, the result is filter correctly, but through query in browser doens't and that is what i need.

    EDIT

    i tried create a page of some fields of Customer table, and expose the through a webservice, but when i query in browser like this

    [url=http://localhost:7048/DynamicsNAV70/OData/Clientes('10000']http://localhost:7048/DynamicsNAV70/ODa ... es('10000'[/url])?$filter=Date_Filter eq datetime'2013-12-31'

    its return "<message>The filter "='31-12-2013 00:00:00'" is not valid for the Date Filter field on the Customer table. '31-12-2013 00:00:00' is not a valid date.</message> "

    could be the same problem?
  • kinekine Posts: 12,549Member
    As I wrote, on page the field is of type String. you need to enter the filter "as in NAV client". It means something like eq '311213' ' or '12/31/13' if it is locale dependant...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • agomes_17agomes_17 Posts: 9Member
    OK but i do that just for testing, what i realy need is using a query object.

    I already tried create another field for "Name" for example, and quering in browser and the result return correct, just in "Date_Filter" doesn't work, i think is because is datetime like you said
  • agomes_17agomes_17 Posts: 9Member
    Hi there,

    Just a little update, i have success exposing a page web service and querying it through browser and using flowfilter "date_filter".

    With object "query" still doesn't work :s as an alternative i'm querying directly the fields of which i want the value, but is not the best solution.

    anyone know other possible solution ?

    TY
  • kinekine Posts: 12,549Member
    like wait for the release? :-) Do not forget, this is beta, there could be some problems and it is needed to report them to have perfect release... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • agomes_17agomes_17 Posts: 9Member
    yes of course :D but I'm working on a prototype that will use this technology and wondered if it was possible, but looks like for now it's not

    Thanks
Sign In or Register to comment.