NAV2013 WebService OData Query - Querying FlowFilter(?)

agomes_17agomes_17 Member Posts: 9
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.

Comments

  • kinekine Member Posts: 12,562
    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 Member Posts: 9
    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 Member Posts: 12,562
    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 Member Posts: 9
    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

    http://localhost:7048/DynamicsNAV70/ODa ... es('10000')?$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 Member Posts: 12,562
    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 Member Posts: 9
    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 Member Posts: 9
    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 Member Posts: 12,562
    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 Member Posts: 9
    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
  • MaxxMaxx Member Posts: 10
    kine wrote: »
    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...

    Hi Kamil, currently I'm using NAV 2017 odata feed and Date Filter (flow filter) doeas not work.
    My link is
    http://localhost:7048/NAV100B16177/ODataV4/Company('CRONUS BELGIË NV')/ChartOfAccounts?$Date_Filter eq 010118 (Page 634 is published)
    Could you please advise how to make it works?
    Thank you in advance
  • MaxxMaxx Member Posts: 10
    Finally, I found working cases (16, 38 pages were exposed as web services):
    For FlowFilter field link should be:
    http://localhost:7048/DynamicsNAV100/OData/Company('CRONUS BELGIË NV')/GLAccountList?$filter=Date_Filter eq '210118'
    where 210118 means 21 Jan 2018
    For Normal field link should be :
    http://localhost:7048/DynamicsNAV100/OData/Company('CRONUS BELGIË NV')/ItemLedgerEntries?$filter=Posting_Date eq 2018-01-21T00:00:00Z (Date in UTC timezone!)

    Hope it will help.
Sign In or Register to comment.