Skip to main content



No record found.

Business Central forum

Web Services(ODataV4) filter on BC

Posted on by 3,957
Hi All,
I've created custom Sales Header Page and Sales Line Page to extract data using Web Services in ODataV4.
I want to apply filters I tried applying filters as follows
giving error: 'Unable to convert value to Date'
giving error: A binary operator with incompatible types was detected. Found operand types 'Edm.Date' and 'Edm.String' for operator kind 'Equal'
I've refered here:
I'm wondering if these filters are available for Web Services or API in BC?
And also what exactly is the difference between API and WebService(ODataV4) as I've found few differences like Parent-Child relationship and complex data types.
Kindy advise!
  • Verified answer
    Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: Web Services(ODataV4) filter on BC

    Hi Stefano,

    I could get the filtered results with query as below'CRONUS%20USA%2C%20Inc.')/DWSalesOrderLinesAPI?$count=true&$filter=Shipment_Date%20ge%202018-05-01 

    Also, I found that the filter is specific to the data type of the field

    For example:

    Date = 2018-09-09

    DateTime = 2018-09-19T20:05:52.667Z

    Integer = 1

    Decimal = 1.00

    Text = ‘Text’

    Code = ‘PS’

    Options = ‘Order’/’Quote’

    Boolean = true/false

    I'll try the query as you provided and give the feedback thanks.

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,154 on at
    RE: Web Services(ODataV4) filter on BC

    The datetime filter is wrong.

    You should write something like:

    Shipment_Date ge datetime'2018-01-01T00:00:00Z'

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,459 Super User

Martin Dráb Profile Picture

Martin Dráb 225,783 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans