Is there a way of specifying which documents are displayed in a view using Lotusscript instead of a formula?
In my case, the users of the database belong to teams. A user has to see only the documents created by members of his own team and I need to do an @ DBLookup to fnd the user’s team name(which cannot be done in a view selection formula)
I tried embedding the view and showing a single category and it works.
I just want to know if there is a simpler way of doing this rather than by embedding all views I have created.
Subject: view selection
Why you don’t use a field readers in your document ?
You create a group by team and when a user create a document your make your @DbLookup to find his group team and put his group in a field readers.
Subject: view selection
The reason you cannot use things like @dblookup in view selection formulas is because views are created and indexed on the server, not on the client. You also cannot user @Username. The view selection cannot contain any information that needs to to be evaluated when the user opens the view.
An embedded view showing a single category is one way to resolve the problem, as the formula for the view category is evaluated on the client at run-time for each user, rather than on the server for all users.
If you need to display documents ‘belonging’ to certain users then Stephane’s suggestion of readers fields is best. This is in-built functionality that works well and also provides better security. Just make sure you include an Admin group or role in the readers field (or a second readers field). I also always set and test readers fields in a replica, in case the value is set incorrectly, and no-one can read the documents (been there, done that too many times!!). That way you can blow away your replica and start again if you have too.
If however, you want to provide a ‘My Teams Documents’ view as well as ‘All Documents’, then you need to stick with the embedded view concept.
Subject: RE: view selection
Thanks Stephane for your proposal…it works.
And thank you Michelle for your explanation.