# Additional info on: AddFoundsetFilterParam

**URL:** <https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775>\
**Category:** Classic Servoy\
**Created:** [November 27, 2003, 8:05pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775 "2003-11-27T20:05:16Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [November 27, 2003, 8:05pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/1 "2003-11-27T20:05:16Z")

</div>

Hi,

Who knows more about this function? I was wondering the following:  
If I have a table with customers of different companies and I want a User of my solution only be able to look at customers of a specific company (also when he/she uses my search functionallity, only results with this companytype can be found): would addFoundsetFilterParam be a good function for this?

Also, when is the filter set by addFoundsetFilterParam undone? I mean by which command?

Paul

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [November 27, 2003, 8:39pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/2 "2003-11-27T20:39:31Z")

</div>

It’s a permanent filter and can’t be undone by a command.  
Would be suitable in your situation.

---

<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:** [November 27, 2003, 8:48pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/3 "2003-11-27T20:48:49Z")

</div>

ok, very handy then!

tnx

---

<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:** [November 28, 2003, 8:33am UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/4 "2003-11-28T08:33:10Z")

</div>

Yes, it is very handy to be able to rely on the filter being permanent. On the other hand it can also be very handy to be able to remove a filter like that. Wouldn’t a method removeFoundsetFilterParam be very helpful. I ran across that problem the other day and thought that was very useful…

---

<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:** [November 28, 2003, 8:40am UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/5 "2003-11-28T08:40:09Z")

</div>

I can think of reasons why I would like to have the remove functions in the future… ![:D]( "Very Happy")

---

<div class="post-metadata">

**Author:** ![chris](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@chris](https://forum.servoy.com/u/chris)\
**Post date:** [January 20, 2004, 5:34pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/6 "2004-01-20T17:34:11Z")

</div>

Confused too how to use this:

1. If the user performs a find in a form that had the addFoundsetFilterParam, will the user’s criteria be added to the criteria already stored? Any cases where it would not?

2. What do we do to undo it? It really takes away from its power not to be able to undo it. If you need examples, I’ll privide many.

3. Is it permanent even if the solution is closed?

Thank you.

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [January 20, 2004, 6:57pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/7 "2004-01-20T18:57:57Z")

</div>

1)The foundset is bound by the filter. This means if the filter shows id’s from 1 to 10, user will never retrieve id 11 when performing a find.

1. It’s indeed not possible to undo. (Unless you of course release the eg. onShowScript , containing the filter, from the form.  
We’d be happy to receive examples where you would need to unlock the filter via scripting.

2. Yes, the moment the filter get’s triggered by , for instance, an onShow script, the filter will remain active no matter what.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [January 21, 2004, 9:44am UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/8 "2004-01-21T09:44:58Z")

</div>

maarten made a small mistake. don’t use onShow but onLoad for this,  
or else you add a param everytime you you go to that form.

---

<div class="post-metadata">

**Author:** ![chris](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@chris](https://forum.servoy.com/u/chris)\
**Post date:** [January 22, 2004, 7:32pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/9 "2004-01-22T19:32:37Z")

</div>

> maarten:  
> 2) It’s indeed not possible to undo. (Unless you of course release the eg. onShowScript , containing the filter, from the form.  
> We’d be happy to receive examples where you would need to unlock the filter via scripting.

To answer your question -

I think other features are more important right now (like menu control and scripted imports/exports) but for the foundset filter params, I was thinking of setting up an “actions” form in which the user by default only sees his actions and so every search is performed within the set of that user’s actions. But I’d want the user to be able to override the default and view all actions if wanted.

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [January 22, 2004, 10:51pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/10 "2004-01-22T22:51:52Z")

</div>

> setting up an “actions” form in which the user by default only sees his actions and so every search is performed within the set of that user’s actions. But I’d want the user to be able to override the default and view all actions if wanted.

create an onShow script that does following (pseudo code)  
1)enter find mode  
2)userId = globals.userId  
//create a checkbox or whatever on the screen  
// that can clear the globals.userId. Add this same script to the onChange property of the checkbox/combobox/…  
3)perform search

also look in the crm demo under actions  
(in the top are filters that influence the list you see.)

---

<div class="post-metadata">

**Author:** ![chris](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@chris](https://forum.servoy.com/u/chris)\
**Post date:** [January 23, 2004, 6:28am UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/11 "2004-01-23T06:28:55Z")

</div>

Ok, thank you.

---

<div class="post-metadata">

**Author:** ![mattman](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mattman](https://forum.servoy.com/u/mattman)\
**Post date:** [February 3, 2004, 4:37am UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/12 "2004-02-03T04:37:00Z")

</div>

```auto
controller.addFoundSetFilterParam('pn_uid', '!=', '1');

```

I’d like to specify additional filters.

Do I have to use multiple addFoundSetFilters or is there another way?

I’ve tried the following

```auto
controller.addFoundSetFilterParam('pn_uid', '!=', '1', '2', '3');

controller.addFoundSetFilterParam('pn_uid', '!=', '1' || '2' || '3');

```

How do you specify multiple values for a single data provider?

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [February 11, 2004, 2:15pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/13 "2004-02-11T14:15:54Z")

</div>

best thing todo whould be:

```auto
controller.addFoundSetFilterParam('pn_uid', '>', '1');
controller.addFoundSetFilterParam('pn_uid', '<', '4');

```

---

<div class="post-metadata">

**Author:** ![Westy](https://avatars.discourse-cdn.com/v4/letter/w/9de053/32.png) [@Westy](https://forum.servoy.com/u/Westy)\
**Post date:** [April 23, 2004, 3:40pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/14 "2004-04-23T15:40:36Z")

</div>

If have been experimenting with the addFoundSetFilterParam. In many ways it is really great. However, after setting the filter I am not clear on how to perform a search within the found set and still be able re-establish the original filtered found set after doing the search. Every time I try to do this my set breaks. So I am able to do the filter, and I am able to do the search, but I am unable to get back to my original filtered found set. If someone could offer some sample code that can achieve this, I would greatly appreciate it.

To set the initial filtered set, I am currently using:

forms.form1.controller.addFoundSetFilterParam(‘Templateid’,‘=’,globals.gTemplateid);  
forms.form1.controller.loadAllRecords();

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [April 23, 2004, 4:55pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/15 "2004-04-23T16:55:28Z")

</div>

> maarten:  
> It’s a permanent filter and can’t be undone by a command.  
> Would be suitable in your situation.

---

<div class="post-metadata">

**Author:** ![Westy](https://avatars.discourse-cdn.com/v4/letter/w/9de053/32.png) [@Westy](https://forum.servoy.com/u/Westy)\
**Post date:** [April 23, 2004, 7:27pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/16 "2004-04-23T19:27:26Z")

</div>

> maarten also:  
> The foundset is bound by the filter. This means if the filter shows id’s from 1 to 10, user will never retrieve id 11 when performing a find.

When I do a search, it does only find those records meeting the search criteria that are in the filtered set. That’s good. However, it gets locked into that found subset of the filtered set and I am not able to go back to the full filtered set. Should I not be doing a regular search within the filtered set, but instead be applying another method for a new filtered set?

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [April 23, 2004, 8:28pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/17 "2004-04-23T20:28:46Z")

</div>

> forms.form1.controller.addFoundSetFilterParam(‘Templateid’,‘=’,globals.gTemplateid);  
> forms.form1.controller.loadAllRecords();

Did you try splitting the above code into two scripts?  
By default you should put your addFoundSetFilterParam inside your startupscript (onLoad), and never trigger it again once solution is opened.

---

<div class="post-metadata">

**Author:** ![Westy](https://avatars.discourse-cdn.com/v4/letter/w/9de053/32.png) [@Westy](https://forum.servoy.com/u/Westy)\
**Post date:** [April 23, 2004, 10:54pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/18 "2004-04-23T22:54:18Z")

</div>

Yes, splitting it worked. Thank you! ![:D]( "Very Happy")

> patrick:  
> On the other hand it can also be very handy to be able to remove a filter like that. Wouldn’t a method removeFoundsetFilterParam be very helpful.

I strongly agree with Partrick’s suggestion. Having a removeFoundsetFilterParam would be extremely helpful to us.

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [April 24, 2004, 9:58am UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/19 "2004-04-24T09:58:43Z")

</div>

You can emulate a permanent filter.  
This sample solution shows a customer list with a country filter.  
If you set (pulldown)filter to eg “France”, you can do a free search on company name within France.  
Note: You have to disable CTRL+F property, so that user can’t bypass  
the interface.

There’s already a req feature for pausing the Ctrl+F in find mode,  
which might give you scripting opportunity to add your own filter besides the manually entered search criteria of the user.

---

<div class="post-metadata">

**Author:** ![Westy](https://avatars.discourse-cdn.com/v4/letter/w/9de053/32.png) [@Westy](https://forum.servoy.com/u/Westy)\
**Post date:** [April 24, 2004, 12:13pm UTC](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775/20 "2004-04-24T12:13:51Z")

</div>

> maarten:  
> You can emulate a permanent filter.  
> This sample solution shows a customer list with a country filter.

That is one elegant solution. Simple, fast and all done with one method. Plus it helps bring into focus the difference between “onAction” and “onDataChange” and how they can be used to leverage a single method. Thank you very much!

[Next page](https://forum.servoy.com/t/additional-info-on-addfoundsetfilterparam/775.md?page=2)
