|
|
|
|
|
|
|
|
|
|
Dynamic view filtering in Notes (continued)
Then in the code pane, you then add a formula that calculates a value. That value is then compared against the view, and will only show the data for any category that matches the formula result. In my case, because the view is categorised on the person's abbreviated name, the formula I used was:
@Name([Abbreviate];@UserName)
|
Now, when the user opens that page, he will be shown only data for himself.
Yes, I hear you say that you I could have done that with reader name fields, and yes, I could. But using a single category view is actually much faster, because the view doesn't have to be filtered to remove documents by reader name.
That mattered here, because there might be several thousand documents in the database, but only one or two for each user, which would have given a severe performance hit while the view was being filtered by the reader names. And of course, this single category view idea can be used for values that can't drive reader names fields. The single category formula can use any data from the form/document or page that it is embedded in, or, as in my case, information about the current user.
@SetViewInfo The second method of view filtering is to use @SetViewInfo. @SetViewInfo filters a view by values in a specific column, and is Notes-client only.
The syntax of @SetViewInfo depends on whether you are using it in a Calendar view or a Standard Outline view. According to the 7.0.1 Designer help, the syntax is like this:
@SetViewInfo( [SETVIEWFILTER] ; filterString ; columnName ; isCategory )
|
The first parameter is constant; you must specify [SETVIEWFILTER]. The real work is done by the second and third parameters.
In the second parameter, filterString, you give a value that is to be searched for in the column described by the third parameter. Just be careful when specifying the third parameter. You should use the programmatic name of the column, which you need to get from the column properties box, propeller-head tab, as shown in Figure C.
FIGURE C
Be sure to use the programmatic name of the column. Click picture for a larger image.
The idea is that when @SetViewInfo is used, Notes displays only rows where the specified column contains the specified value. But reality is just slightly different.
Designer help, as we have seen, states that @SetViewInfo has four parameters, but when you start to type, Designer's parameter prompt (in Designer 7.0.1) thinks that @setViewInfo actually has five; two parameters after the column name (bIsCategory, and bDoExact) as shown in Figure D.
FIGURE D
Designer's prompt things there are five parameters. Click picture for a larger image.
You can see @SetViewInfo in action in your mail database. Open it and go to the calendar view. You'll notice a Filter action, which allows you to filter your calendar by a variety of entries. Figure E shows my calendar filtered by type to show just All Day Events.
FIGURE E
It's not that I've got a lot of free time, just that I'm only showing All Day Events. Click picture for a larger image.
Here's the code that implements that set of choices:
[ Prev | Next ]
|
|
|
|
|
|
-- Advertisement --
AUTOMATE LOTUS NOTES USER ID MANAGEMENT
ID Manager 4.5 from HELP Software provides a new level of automaton for managing Lotus Notes IDs. ID Manager lets Lotus Notes administrators get out of the business of creating and managing user IDs. Use our ROI calculator to see how quickly ID Manager will pay for itself.
Learn more about HELP Software products |
-- Advertisement --
The Ultimate Notes Domino Training Experience - Amsterdam, 11-13 November
Get in-depth technical training that you can put to use on the job right away at THE VIEW's Admin2008 and Lotus Developer2008 Europe! One registration gets you into your choice of over 70 new and updated expert know-how sessions, one-on-one consultations, hands-on labs, and more.
See complete agendas and register by 10 October to save 495 euros! |
|
|
|
|
|
|
|
|