This simple setup will allow your databases to remember the last view opened by each user, while using framesets.
The database is set to launch a frameset on open. The frameset contains two frames, Frame "a" for a page with an outline containing links to views and frame "b" to displaying the view itself. There are two views in this database, view "v1" and view "v2."
In the Initialize event of each view, place the following script:
Sub Initialize Dim ses As New NotesSession Dim db As NotesDatabase Dim count As Integer, dbname As String, nospaces As String, hold As String 'Retrieve the title of the current database. Set db = ses.CurrentDatabase dbname = db.Title 'Remove the spaces from the title. For count = 1 To Len(dbname) holdtitle = Mid(dbname, count, 1) If Not hold = " " Then nospaces = nospaces & hold End If Next 'Set an environment variable to the name or alias of the current view. Call ses.SetEnvironmentVar( nospaces & "_View" , "v2") End Sub
In the frame properties of frame "b" set the Content Type to a Named Element and a View with the following computed formula value:
hold:=@Environment(@ReplaceSubstring(@DbTitle;" ";"") + "_View"); @If(hold="";"v1";hold)
This formula will open the "v1" view by default if the user has not been in this database before, otherwise it will open the most recently accessed view.