Using a relation as a filter

Hello,

I want to be able to filter data by one column and use a relation for that. It works great, but I don’t see how I can implement a “show all” using that technique.

The relation I am using is setup like this

PK → FK
globals.filter → aColumn

If I add an item to globals.filter that is null, Servoy queries for NULL. If I add ‘’, Servoy queries for NULL. Is there a way to not let Servoy query aColumn at all?

Thanks!
Patrick

just use: controller.loadAllRecords() on the related form
it will overwrite the relation.

If you do: controller.loadRecords() you have your relation back!

hmm. I knew that, but I am not sure it helps my design.

The relation I am talking about is used to show related data in a tab panel. So my user has a form with that tab. If he filters for one item, that works fine. If he browses through records in the main form, that filter is always applied (that’s why I like to use a relation). But if he sets the filter to none, I have to (manually) do something. Now when he browses to the next record with the filter set to “show all”, I also have to do something. That destroys the charm of using a relation (because I have to script). If I have to script this, I can also do a simple search…

The nice thing about using the relation is that Servoy takes care of it without me doing anything.

patrick:
hmm. I knew that, but I am not sure it helps my design.

The relation I am talking about is used to show related data in a tab panel. So my user has a form with that tab. If he filters for one item, that works fine. If he browses through records in the main form, that filter is always applied (that’s why I like to use a relation). But if he sets the filter to none, I have to (manually) do something. Now when he browses to the next record with the filter set to “show all”, I also have to do something. That destroys the charm of using a relation (because I have to script). If I have to script this, I can also do a simple search…

The nice thing about using the relation is that Servoy takes care of it without me doing anything.

Just use a “LIKE” relation instead of a “=” relation, this way using “%” in the global field you can show all related data, using “Serv%” you can get Servoy or Server or guess what. I find it really handy.

That’s a smart idea! I think about this (both columns involved are integers…).

Thanks for the tip.