Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi! I'm using an expression in a Listbox L with multiple aggr()'s like the following:
if(account.activated = 'yes' and aggr(max({<user.id>}account.policy), user.id) <> 1 or aggr(max({<user.id>}account.policy), user.id) = 1 and account.activated = 'no', 'Not usable',
if(account.activated = 'yes' aggr(max({$}account.policy), user.id) = 1, 'Usable'))
What I'm doing here is to check:
What I'm getting is Listbox L with two fields 'Usable' and 'Not usable'.
Next step I did was creating a Tablebox T with the user.id and a column 'Usable?' with a similar expression.
It's not a problem to filter in Listbox L between 'Usable' and 'Not usable' user accounts.
The strange problem is: If I'm selecting multiple (let's say 5) user.id's at first, it shows me the user.id's in column 1 and if their account is usable or not in column 'Usable?'. I'm able to press on my button 'Usable' from Listbox L and it only shows me 3 of 5 user.id's that are usable indeed. But if I'm pressing on my button 'Not usable' from Listbox L, it deselects my current selection and shows me all user.id's in my Tablebox T, that are not usable.
My assumption is, that I'm mixing something with the double aggr()-function, that I do not understand. Is there a mistake I fail to understand or are there any other ways to filter in my Tablebox T for 'Usable' and 'Not usable' after selecting multiple user.id's at first?
Thanks in advance (and for reading)
I corrected the following
aggr(max({<user.id>}account.policy), user.id) <> 1
to
aggr(max({<user.id>}account.policy), user.id) = 0
altough I do not fully understand the reason, because there are only the possible values 0 and 1 and it shouldn't make a difference.
But the aggr()-function sometimes does magic stuff.
So for some documentation I'll leave this here
I corrected the following
aggr(max({<user.id>}account.policy), user.id) <> 1
to
aggr(max({<user.id>}account.policy), user.id) = 0
altough I do not fully understand the reason, because there are only the possible values 0 and 1 and it shouldn't make a difference.
But the aggr()-function sometimes does magic stuff.
So for some documentation I'll leave this here