Manage Learn to apply best practices and optimize your operations.

Remember the last view opened by each user

This simple setup will allow your databases to remember the last view opened by each user, while using framesets.

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.

This was last published in September 2001

Dig Deeper on Domino Resources - Part 7

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close