|
|
|
|
|
|
|
|
|
|
|
|
|
|
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. Roll over 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. Roll over 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. Roll over picture for a larger image.
Here's the code that implements that set of choices:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Teamstudio Edition 25 has shipped
It's finally here! Now that Teamstudio Edition 25 has shipped, listen to our latest Tool Time audio program to find out what's changed. Updates to all your favorite Teamstudio tools will be discussed.
Plus, you'll get an introduction to Teamstudio Undo (formerly known as Teamstudio Snapper).
Tap here to get started! |
|
|
|
|
|
|
|
|
|
|