Serenity: FilterField and FilterValue

Created on 7 May 2018  路  19Comments  路  Source: serenity-is/Serenity

I have a filter field and value set up on the LookupEditor of the row class:
[LookupEditor(typeof(AccountsRow), FilterField = "IsInvestorAccount", FilterValue = 0)]

The field is included in the lookup on the AccountsRow page but it will not filter in the form drop down. I see it selecting the IsInvestorAccount field when I click on the drop down but it doesn't filter it. Can someone help with what I'm doing wrong?

community-support has-documentation question

Most helpful comment

Maybe you missed to put LookupInclude on your IsInvestorAccount field in AccountsRow ..

All 19 comments

Maybe you missed to put LookupInclude on your IsInvestorAccount field in AccountsRow ..

I have LookupInclude. I can see the field included in a sql trace. It just doesn't filter by the field.

Is there any result in the lookup editor or is it empty?

I don't understand what you mean. It's a drop down. It has values when I click on it. They just are not filtered.

do you want to have distinct values in filter, or filter them out as u filter?
or, when u pick up one value in filter, it wont filter down the grid?

There is a lookup on a field. I would like that lookup filtered based on the value of another column. It is not filtered.

@leahmayschneider is this thread hijacking or what?
anyway, what u want is lookup cascading. check out samples in orders (Country, City)

@ga5tan I'm sorry I logged in on my other account.

I do not want cascading. I want the values in the lookup to be filtered by a preset value (in this case always 0), not based on the value of another lookup. I want FilterValue and FilterField.

ic. cool deal.
anyway, I guess it may be possible. but u prolly have to filter it down in TS, since u gotta do filtering on FE then... I would still check into cascading, since that works like that ...

Try with some value other than zero

It does work with a value other than 0 but this doesn't help me filter on the value 0.

Can't reproduce this, 0 is working fine as a filter value.

hey everyone!
My question is can we add Not EqualsTo term for FilteraValue?
Because I want my dropdown should be Filtered all value except one

@Shraddha996 Did you try MyField != MyValue ?

@MagDev175 Your Database is storing that data as boolean or Integer ? , try using false for your filter value and see if that works for you .

@stixoffire It's been awhile since I've looked at this since I found a workaround but I generally have better luck with filtering on 0/1 as opposed to false/true.

@MagDev175 Yes I prefer 0/1 integer values as it is easier to migrate to 0/1/2 , in my case I had my db as I preferred integers, but in my code as my brain logic is boolean .. so the code was written for boolean and it just did not like to filter (which brought me here) and then the Homer DOH!.. which got me working. I changed DB to bit and used true/false it worked correctly. I am thinking integer would have been fine if my datatypes matched.

@MagDev175
Did you find the solution ?
I'm in the same problem now

@Mohamed-Ali-Salim I'm sorry it was so long ago and I no longer remember. I don't have that code snippet in my code any more so I'm guessing I couldn't find a solution. I almost definitely set the filter in the grid or dialog ts class.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kilroyFR picture kilroyFR  路  3Comments

moostafaa picture moostafaa  路  3Comments

newyearsoft picture newyearsoft  路  3Comments

Akarsh03 picture Akarsh03  路  3Comments

dudeman972 picture dudeman972  路  3Comments