When opening a database in a Notes Client that is using Frames, typically you set the Database Launch Property to Open designated Frameset and select the Frameset to open. When you create the Frameset you typically put the default View in the main content frame and that view is what all users see when they open the database.
Recently I was challenged by a user of an application I just put into production, that he wanted the database to open to the view he was in last. I thought, how can I achieve this still using the Frameset UI. There isn't a way to do this using standard Launch Properties so I had to do it manually and here is how.
In the Post Open event of each view I have the following code:
Sub Postopen(Source As Notesuiview)
Dim notesSession As New NotesSession
Call notesSession.SetEnvironmentVar( "RALastView", Source.ViewAlias )
End Sub
In the main content frame I use a Named Element of View type and the value is computed With the following formula:
viewName := @Environment( "RALastView" );
@If( @IsError( viewName ) | viewName = "";
"Use Alias of Default View Here";
viewName
)
Now I have a simple way to allow the user to Restore as Last Viewed while getting the rich UI of Frames.
Steven L Rieger
PCLP
Manager Information Systems
srieger@psclistens.com