D365 BC OData: Filtering for boolean fields in the correct way
This content has 3 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.Somehow, Microsoft’s documentation for using OData service in Business Central does not give enough information for the proper usage of the OData’s filter for boolean fields. That’s when Postman becomes your best friend, and you are starting arguing about how to compare equality to a boolean field using filters. Oh, have you looked up stackoverflow already? Some say, that you will need to make a new column in the page, and put the boolean value as a string, to be able to use it in filter with string compare!! 😀 Others say, you will need to send the equality compare statement with binary marks, 1 for true and 0 for false. None of the solutions mentioned will work. I mean the string compare method should work, but I recommend to use it for no one. My test results The solution The boolean operators in OData filters are CASE SENSITIVE, and marked with true and false. You won’t need to put in single quotation marks, or use binary marks like 1 or 0. The solution is simple:
Hi, I am András,
I am a seasoned software engineer from Budapest, Hungary with a strong focus on mobile app development using .NET MAUI and Xamarin.Forms. My expertise also extends to website building for my happy customers and other complex system designing. I am passionate about developing well-organized, maintainable software solutions.