Open a view that the user selects in a window prompt

Use the LotusScript or Formula to open the desired view selected by the user. The database has a graphic navigator in a dual frameset, where the data resides in the "RightPane" named frame.
Lotus Formula • Lotus Notes View • LotusScript

LOTUSSCRIPT VERSION

Sub Click(Source As Button)
	
	Dim workspace As New NotesUIWorkspace
	Dim session As New NotesSession
	Dim db As NotesDatabase
	Set db = session.CurrentDatabase
	Dim uidb As NotesUIDatabase
	Set uidb = workspace.CurrentDatabase
	
	Call workspace.SetTargetFrame("RightPane")
	
	Dim years(10) As String
	years(0) = "2002"
	years(1) = "2003"
	years(2) = "2004"
	years(3) = "2005"
	years(4) = "2006"
	years(5) = "2007"
	years(6) = "2008"
	years(7) = "2009"
	years(8) = "2010"
	years(9) = "2011"
	years(10) = "2012"
	
	Dim answer As Variant
	answer = workspace.Prompt( PROMPT_OKCANCELLIST, "Service Cap", "Please select the year.", Cstr(Year(Today)) , years )
	
	If answer Then
		Dim view As String
		view = "SRBSC" + answer
		Call uidb.OpenView(view)
	End If
	
End Sub

FORMULA VERSION

answer := @Prompt([OKCANCELLIST]; "Year Selection"; "Select a desired view by year."; @Text(@Year(@Today)) ;
"2002" : "2003" : "2004" : "2005" : "2006" : "2007" : "2008" : "2009" : "2010" : "2011" : "2012" ) ;

@SetTargetFrame("RightPane");

@If(
answer = "" ; "" ;
@Command([OpenView];"SRBSC" + answer)
)

Posted by fbrefere001 on Tuesday February 4, 2003