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?
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…
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?
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.
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.
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.
Yes, the moment the filter get’s triggered by , for instance, an onShow script, the filter will remain active no matter what.
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.
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.)
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:
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?
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.
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.
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.
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!