Page 1 of 1

Logical Operators for Relationships

PostPosted: Tue Apr 23, 2019 5:49 pm
by rafig
I find myself in need of filtering a tab panel, but I want to do it based on one column having one value OR another value (or even another).
Currently, when you define a relationship, each line is AND'ed.
It would be nice to have a way to change the linking of the lines to allow 'OR' as well.
I guess the UI would have to be an extra column in the relationship dialog that defaults to 'AND' but you could change to 'OR' and the OR would be between that line and the next??

(I know that I could work around this by having a numerical values for the column and use globals & >= and <= lines, but I just want to be able to list some text values...)
[To define my example, I have a 'Notes' table related to 'Clients' and there is a column 'note_type' with values like email/phone/post/label and I want to create a relationship like
Code: Select all
client -> notes
id = client_id
globals.post_text LIKE note_type OR
globals.label_text LIKE note_type
so that it only shows notes that are 'post' or 'label' for that client
if there is some other way of doing this easily, please let me know ;-) ]

Otherwise, would this feature be possible??

Re: Logical Operators for Relationships

PostPosted: Fri May 17, 2019 10:48 am
by rgansevles

You could use the Query Builder, either load the foundset with it or use the new foundset filter param feature where you can use the Query Builder.
You can create an OR-condition and apply it as a filter or query to your table panel foundset.

A filter cannot be applied to a related foundset, so you would have to make a copy


Re: Logical Operators for Relationships

PostPosted: Fri May 17, 2019 3:34 pm
by rafig
Thanks Rob, I might try that out.
Ideally, it would be nicer/easier if it was part of the relationship dialog setup ;-)