Hi,
I want every record that doesn't contain a specific word.
I've tried the following:
"not(contains({Field}, '{Value}'))" resulting in "Client requests that contain ''Not'' filter options are not supported by Dynamics 365 Business Central OData web services."
"not contains({Field}, '{Value}')" resulting in "Client requests that contain ''Not'' filter options are not supported by Dynamics 365 Business Central OData web services."
"indexof({Field}, '{Value}') eq -1" resulting in "Client requests that contain ''indexof'' filter options are not supported by Dynamics 365 Business Central OData web services."
Can anyone explain why this is happening and why these things are not supported while the documentation here says that it does and how I can fix this?\
learn.microsoft.com/.../use-filter-expressions-in-odata-uris
Hi
I found a solution to this.
I found out that contains works in a bit of a weird way. We need to compare it to a boolean.
For example:
contains({Field}, '{Value}') eq true
But to check if it DOESN'T contain a certain value we have to use ne true instead of eq false. Because eq false doesn't return any records but says that the odata uri query is valid. So for some reason using ne true does return the correct records.
For example:
WORKS: contains({Field}, '{Value}') ne true
DON'T WORK: contains({Field}, '{Value}') eq false
Hi Daniele
The problem with the first link is that my list would be way too big. There are too many combinations to consider which is why I need a contains functionality or something similar to that.
The second link is a link that I'm already aware of. But for some reason some of those filter expressions are not supported. Any idea why?
Bo
Hi Zhu
I've tried a few things as described above. Which one of the things was the indexof and unfortunately it says that it isn't supported.
Bo
Hi, unfortunately, as far as I know, "not" is not supported in BC's API and Odata's filter method.
I'm not sure if "indexof" is supported. Anyway we can only avoid using these methods.
Hope that other experts can give you better advice.
Thanks.
ZHU
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,104 Most Valuable Professional
nmaenpaa 101,156