Range Search Field related

I have created DateSearch as non persistent entity having attributes start date and end date. I want to use range search field to retrieve dates between two dates. How to provide upper bound and lower bound for this??   This is my domain module and I want to retrieve dates from user entity.
2 answers

The Range search-field is not self-explanatory. You would expect that it gives you the option to set a lowerbound and an upper bound and then find all objects having their date-attribute in the given range. But that is not it. The range requires you to give two date-attributes of the entity that will be the start and end of the range. At runtime, the user can enter one value in the searchbox and the search will return all objects having their start-attribute before the given searchdate and their end-attribute later then the given search date. See https://docs.mendix.com/refguide/range-search-field#introduction for more details.

You on the other hand want the opposite. To get that, the solution is easier then you think: Add two searchfields of type Comparison for the attribute that you want to be in the range. One you set the property ‘Comparison’ to ‘Greater or equal’, the second you set the property ‘Comparison’ to ‘Smaller or equal’. That's it.


Retrieve where Date>= StartDate and Date <= EndDate