Howdy…I have a view which is embedded in a form. I am trying to pass a text list from the form to the view as part of the Select clause. I’ve looked for an answer here, on the web and among my colleagues with no results.
Am I asking Lotus Notes for something it can’t/won’t do or is there some way to make a truly dynamic Select clause.
About the only way to create a dynamic view is to write code to modify the Select statement before you open the view. That would would, unless you have multiple people using the same view at the same time.
The Select statement is NOT executed when you open the view in order to build the view - views are based on view indexes, and when you open a view, only documents that have been updated since the last index refresh are processed with the Select statement.
Hi,You can use folders and add the documents based on condition if you want a dynamic view. But make sure that there is only one user or you can use Temporary Folder and delete it when the user exit the page.
If you can make the view a categorized view based on the keywords field that is to be selected in the Form, and when the category is selected, the form can be reloaded/refreshed to see the changed list. It may or may not be possible if you need to display documents for multiple categories - unless you can make combinations of those choices in the view in advance. If you haven’t explored this option of “Show single category” , and you think this may help, look up in help & try it, and we can discuss more.
Thanks, Amy. I did try single category but I need more than one value for the category. I’m thinking that the selector needs to be boolean, rather than string.
I guess it will depend on your exact situation - if you know the category values and they are very limited in numbers, or if you know those values are static, you may be able to build the view with one category for each combination of the choices (example: cat1, cat1+cat2, cat1+cat2+cat3, cat1+cat3+cat5… grows exponentially).If it didn’t need more than one value for the category at one time, I guess you would have taken the single cateogry route (if the dynamic view contents are not for a report or something, but just to look at, say, the user just need to see the view contents based on the category they select in the form, and then they can try by selecting another one - boolean/radio-button selector).
Thanks for your idea of the button. Yeah, I’ve tried the 'single-category route and there are just too many choices and some are shared among several - but not all - people.What I need is select statements like
SELECT "@IsMember(Agency;“DOD”:“USA”:“USAF”) for one person and
for another, with yet other choices for several other people. I can use an environment variable to store the elements of the list of agencies I need to get and I can actually change the NotesView.SelectionFormula during the QueryOpen event. However, even though I can display it in the PostOpen event and it appears to be correct, I have to re-open the view to make it take effect.
From what I’m seeing, it doesn’t look as if I’ll be able to do this automagically. Oh well, back to the drawing board…
I finally found a solution, thanks to Amy Knox and her team at IBM/Lotus. The view selection formula needs to be changed not just prior to opening it, but prior to calling it as a uiview. We wound up using a formula to write the variable to an Environment variable, then called, via the RunAgent @Command, a LS agent which retrieves the environment variable written by the formula, uses it to build the SELECT statement in its entirety and writes the SelectionFormula property to the back end viewEven with this, we still needed to put @Prompt between the call of this agent and the opening of the view so that the back end write would take place in time. But it works.