Manage Learn to apply best practices and optimize your operations.

Build list of views, and open selected view via LotusScript

How to build a list of all views in the current DB and then open the selected view in the specified frame within a frameset.

This code will build a list of all views in the current database, and then open the selected view in the specified frame within a frameset. This can be very tricky because it uses the NotesUIworkspace to instantiate an object of the NotesUIdatabase class.

Sub Click(Source As Button)
 On Error Goto processError
 Dim workspace As New NotesUIWorkspace
 Dim Session As New NotesSession
 Dim uidoc As NotesUIDocument
 Dim collectionDoc As NotesDocument
 Dim collectionViews() As String
 Dim doc As NotesDocument
 Dim uidb As NotesUIDatabase
 Dim db As NotesDatabase
 Dim thisView As String 
 
 Dim i As Integer
 
 i = 0 
 Set db = Session.CurrentDatabase
 Set uidb = workspace.CurrentDatabase
 
 Forall v In db.Views
  temp = Cstr(v.name)
  Redim Preserve collectionViews(i + 1)
  collectionViews(i) = v.name   
  i = i + 1   
 End Forall
 
 thisView = workspace.Prompt
(PROMPT_OKCANCELLIST, "Available Views", 
"This is a list of views in this database. 
Highlight the view you want to open and
 select OK.",  collectionViews(0), collectionViews)
 Call workspace.SetTargetFrame
("your_target_frame")
 Call uidb.OpenView(thisView, "", "1") 
 
 
processError:
 Resume Next
End Sub

Do you have comments on this tip? Let us know.

Dig Deeper on LotusScript

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