Filtering by multiple fields
SAPUI5 filters do not seem to support OR condition across different fields. See example at http://jsbin.com/nexok/7/edit - note you will have to disable same origin policy to get data. I have a search field where I want to enter name and search across FirstName and LastName field. The filter condition produced is "$filter=substringof(%27Nancy%27,FirstName)%20and%20substringof(%27Nancy%27,LastName)", when what I want is $filter=substringof(%27Nancy%27,FirstName)%20or%20substringof(%27Nancy%27,LastName)
Cheers Graham Robbo
Hi Graham,
filters are automatically ANDed if you only pass an array of filters into the filter function. If you want to OR the filters you have to use an additional filter, which applies the OR condition.
I changed your example here: http://jsbin.com/siliqali/1/edit
Regards, Christoph
Thanks a million Chris - super fast response too. I owe you a beer if we ever are in the same place at the same time.
Cheers Graham Robbo