View member feedback to this tip.
I was asked to provide a calendar view to users, so they could select on the fly what documents were included in the calendar view, based on a designated category. The problem became more difficult when the designated categories were dynamic (i.e., changeable and able to be added to or deleted from).
To solve this problem, I needed to be able to supply the users a way of changing the views selection criteria on the fly. This ability is limited to only Designer access and above, so how could I give this functionality to the end users?
I used the Notes 6 functionality of assigning an agents "run on behalf of" property. I created two agents. The first was called from an outline entry and requested the user to select the category they wished to limit the calendar view selection to. The second agent was called from the first agent (the one where I assigned the "run on behalf of" property to the username we use to sign all of our databases, and, as a default, has manager access to this database).
Here's the code I used in the agents:
MEMBER FEEDBACK TO THIS TIP
Is this a single user application? Once the view selection formula is changed on the server, won't it be changed for all users of the application and possibly cause issues if more than one person is using the database at a time?
Brian A.
******************************************
No, this is a multi-user database. I had the same question, but fortunately, the continuous change to the view was accepted by the u
To continue reading for free, register below or login
To read more you must become a member of SearchDomino.com
');
// -->

sers. The view is used for reference purposes only and each time it is needed, the code forces them to select the criteria and hence, get the view they want. The view will stay the same on their client until they change views or exit the database, even if someone else uses the database on a different client and selects a different criteria.
If this is not acceptable for others, then I can only suggest you try "private on first use" views and see if the same functionality can be applied to these types of views.
Graham Frey, tip author
******************************************
Why don't you just use @SetViewInfo?
Hassan V.
******************************************
In most circumstances you could definitely use the @SetViewInfo function. But, in my case the selection criteria did not end at just one selection. The application needed to be able to provide further categorization based on the previous selections. I could not utilize @SetViewInfo because I needed to know what the previous selections were.
My code was enabling them to categorize the calendar and then drill down to further categories within the previous selections.
Graham Frey, tip author
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip exchange by member Graham Frey. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.