Additional info on: AddFoundsetFilterParam

I have not used the ‘addFoundSet FilterParam’ function as yet.

Many have alluded to the ‘permanent’ state of this function once applied.

When does this applied filter stop then ?

Does it stop when a solution is closed and then get applied when a solution is opened again ?

What is the actual lifespan of a foundset filter ?

Harry

The lifespan is for the duration of the solution being open after being applied.
It was created with in mind the senario for example, where the sales department never should see purchase info.

Thanks Jan,

Just so I completely understand the current level of its functionality :

Can I do the following :

globals.filterKey = "Sales"

Then apply the filter using :

controller.addFoundSetFilterParam('department', '=', globals.filterKey);

This would mean that I could change the contents of the ‘globals.filterKey’ field at any time and then reapply the filter to change the foundset !?

Or does it work that once set with a value then it does persist until the solution is closed and reopened - even if you performed another method which changed the filter to the ‘Support’ department ?

Cheers
Harry

it does set it once!
So you never set a reference to the global. You set the value that is in the global at THAT Time.

Is it possible to use addfilterparam to filter based on multiple unrelated values (id = 1 or id = 4 or id = 695, etc.)? Put another way, can you do either an ‘and’ or an ‘or’ with addfilterparam?

Hi Jerry,

Currently the addFoundSetFilterParam is an “AND” only - the “OR” operator is not supported. The main reason is it’s hard to specify the cardinality (where the parenthesis goes). That’s because you might want something like this:

AND (a=1 or a =2 or a=3 OR (b=12 AND c= 9 OR (d=3 AND f=12)))

Once the “OR” is breached, it opens a whole new “can of worms.”

Personally, I would LOVE to have the “OR” capabilities as well. Here’s one thing that I do that helps in my solutions:

Make a global subroutine that will add all the other fields to your search, then just call that subroutine before you perform your finds. I also have subroutines for my SQL queries as well - so I can apply them as needed in my custom SQL queries.

Hope this helps,

Bob Cusick

Thanks, Bob. Willl give that a shot.