# TableFilters Reload

**URL:** <https://forum.servoy.com/t/tablefilters-reload/6299>\
**Category:** Classic Servoy\
**Created:** [July 31, 2006, 2:03pm UTC](https://forum.servoy.com/t/tablefilters-reload/6299 "2006-07-31T14:03:18Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![bubba](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bubba](https://forum.servoy.com/u/bubba)\
**Post date:** [July 31, 2006, 2:03pm UTC](https://forum.servoy.com/t/tablefilters-reload/6299/1 "2006-07-31T14:03:18Z")

</div>

I would like to have a way to reset a Table filter without having to log into and out of the program. Or alternatively, a way to perform a login and logout proceduraly without exiting the main program.

Would also appreciate documentation on exactly how the table filters work and when they take effect.

Regards,  
Lee Snover

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [July 31, 2006, 2:11pm UTC](https://forum.servoy.com/t/tablefilters-reload/6299/2 "2006-07-31T14:11:07Z")

</div>

Currently, you can’t remove a filter once it is set.

When you set a table filter, the criteria that you passed will be automatically added to every query that Servoy fires against the table. So if you set a filter like ‘city=london’ and you manually search for a city called ‘birmingham’, the query will look like

'SELECT address\_id FROM addresses WHERE city = ‘birmingham’ and city = ‘london’

The last part is added by Servoy. The results of this query will be 0 of course and that’s exactly what you wanted when you specified the filter.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![bubba](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bubba](https://forum.servoy.com/u/bubba)\
**Post date:** [July 31, 2006, 2:21pm UTC](https://forum.servoy.com/t/tablefilters-reload/6299/3 "2006-07-31T14:21:31Z")

</div>

> patrick:  
> Currently, you can’t remove a filter once it is set.
> 
> When you set a table filter, the criteria that you passed will be automatically added to every query that Servoy fires against the table. So if you set a filter like ‘city=london’ and you manually search for a city called ‘birmingham’, the query will look like
> 
> 'SELECT address\_id FROM addresses WHERE city = ‘birmingham’ and city = ‘london’
> 
> The last part is added by Servoy. The results of this query will be 0 of course and that’s exactly what you wanted when you specified the filter.
> 
> Hope this helps.

Exactly, and that’s the problem. I want to use the TableFilter to do record level security and some users I need to be able to change that security while they are in the program. I don’t want to have to make them exit and restart the program.

Thanks,  
Lee

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [July 31, 2006, 3:12pm UTC](https://forum.servoy.com/t/tablefilters-reload/6299/4 "2006-07-31T15:12:06Z")

</div>

Hi Lee,

At the moment you can’t remove tablefilters (nor foundset filters) once they are set.  
If you really need more dynamic filtering then you need to handle all the queries yourself. A bit of a pain, but doable.

I would suggest you add your feature request to the bugbase as well (as a feature request ofcourse) so it won’t be lost in the sea of forum messages.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![bubba](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bubba](https://forum.servoy.com/u/bubba)\
**Post date:** [July 31, 2006, 3:21pm UTC](https://forum.servoy.com/t/tablefilters-reload/6299/5 "2006-07-31T15:21:34Z")

</div>

Robert:

Thanks.

I understand I can do this myself, but that defeats the purpose of using a 4GL. This functionality exists and works well in Filemaker, and actually in Oracle itself as that is our primary DB. However, to use it in Oracle requires specific Oracle user logons, which is prevented by how Servoy interfaces with the database.

It seems like this would be a relatively trivial feature to add, and would save much work and aggravation for developers.

Regards  
Lee

---

<div class="post-metadata">

**Author:** ![JDW](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@JDW](https://forum.servoy.com/u/JDW)\
**Post date:** [August 27, 2007, 8:17pm UTC](https://forum.servoy.com/t/tablefilters-reload/6299/6 "2007-08-27T20:17:40Z")

</div>

Agreed. removeTableFilterParam and removedFoundsetFilterParam would both be very useful.

Since they would be accessible only by the programmer developing the application seems these additions would be of limited security risk for those using filters to hide data.

Related post: [http://forum.servoy.com/viewtopic.php?t=2345](http://forum.servoy.com/viewtopic.php?t=2345)

JW

---

<div class="post-metadata">

**Author:** ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://forum.servoy.com/u/martinh)\
**Post date:** [September 10, 2007, 8:52am UTC](https://forum.servoy.com/t/tablefilters-reload/6299/7 "2007-09-10T08:52:44Z")

</div>

As I understood the table filters can not be removed while you are logged on. But for foundset filters I agree. I already faced the same situation where I needed to remove the foundset filter, because I wanted to do a reload based on a new filter, but unfortunately my new filter was concatenated with the existing filter.

I can imagine that the new foundset filter will only be active when you do a new loadRecords(). As far as I can see, this will be good enough for me.

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [September 11, 2007, 6:33am UTC](https://forum.servoy.com/t/tablefilters-reload/6299/8 "2007-09-11T06:33:05Z")

</div>

All,

A new method removeTableFilterParam is planned for Servoy 4.  
Unfortunately, we cannot implement this in 3.5 easily.

Rob

---

<div class="post-metadata">

**Author:** ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://forum.servoy.com/u/martinh)\
**Post date:** [September 11, 2007, 6:54am UTC](https://forum.servoy.com/t/tablefilters-reload/6299/9 "2007-09-11T06:54:52Z")

</div>

Including also removedFoundsetFilterParam ?

---

<div class="post-metadata">

**Author:** ![olivier\_melet](https://avatars.discourse-cdn.com/v4/letter/o/ba8739/32.png) [@olivier\_melet](https://forum.servoy.com/u/olivier_melet)\
**Post date:** [September 11, 2007, 8:09am UTC](https://forum.servoy.com/t/tablefilters-reload/6299/10 "2007-09-11T08:09:30Z")

</div>

> rgansevles:  
> A new method removeTableFilterParam is planned for Servoy 4.

Great! We thought it would never happens (first request for such a feature in 2004 if I remember well!).

Thank you servoy!

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [September 12, 2007, 6:53am UTC](https://forum.servoy.com/t/tablefilters-reload/6299/11 "2007-09-12T06:53:58Z")

</div>

> martinh:  
> Including also removedFoundsetFilterParam ?

Probably not, the filter is used only during the lifetime of the foundset anyway.

Rob

---

<div class="post-metadata">

**Author:** ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://forum.servoy.com/u/martinh)\
**Post date:** [September 18, 2007, 1:23pm UTC](https://forum.servoy.com/t/tablefilters-reload/6299/12 "2007-09-18T13:23:05Z")

</div>

TableFilters are very useful. For example in my case where in my database I have records for several companies/administrations in one single database.

By login into a company I set the tablefilter and only the records for that company are selected. Great … but …

This tablefilter is not working on INSERT statements. So I have to program in each form now that my company\_id must be filled with the company\_id of the company where I logged in.

It would be very logic that if there is a tablefilter on a certain table, that the tablefilter is also used on INSERT statements.

The best way to do this, seems to me that when a newRecord() method is triggered on a form(so on a foundset) that the value from the table filter will be filled into the foundset. In that case you have the possibility as a programmer still to change this value.

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [September 18, 2007, 1:35pm UTC](https://forum.servoy.com/t/tablefilters-reload/6299/13 "2007-09-18T13:35:30Z")

</div>

That will not work, because a TableFilter is capable of filtering on multiple values (using the In operator). What should be inserted then?

You should do this with the auto enter options available in the dataprovider dialog.

For example, you can do a lookup from a global variable which would contain the owner\_id/company\_id of the user that is logged in.

Paul
