This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


May 28, 2016, 5:11 AM
11 Posts

Opening view using script

  • Category: Domino Server
  • Platform: Windows
  • Release: 9.0
  • Role:
  • Tags:
  • Replies: 1

Hi

I am trying to write a script that gets the name of a view from a profile document then opens the view in the target frame. The issue is that whenever I open the DB the script runs but the view get opened in new frameset not in the the target frame. Following is the script that resides in the Queryopen of the form that I call in the the target frame.

Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
    Dim sess As New NotesSession
    Dim db As NotesDatabase
    Dim view As NotesView
    Dim doc As NotesDocument
    Set db = sess.CurrentDatabase
    Set view=db.Getview("Admin")
    Set doc=view.Getfirstdocument()
    
    If Not doc Is Nothing Then
        Forall x In doc.NEW_TrackedFields
            fieldvalue=doc.Getitemvalue(x)
            If fieldvalue(0)=db.Filepath Then
                viewname=doc.Getitemvalue("DefaultView_"+Right(x,1))
                Exit Forall
            End If            
        End Forall
    End If
    
    Dim ws As New NotesUIWorkspace
    Dim uidb As NotesUIDatabase
    Set uidb = ws.CurrentDatabase
    Call uidb.OpenView(viewname(0), ,False,True)    
    continue=False
End Sub

 

Please advise urgently

Thanks

May 31, 2016, 4:43 PM
323 Posts
You can try NotesUIWorkspace.SetTargetFrame, but I'm unsure the attempts will work in this...

Normally you'd need to to set the target frame, and then open the view.

However, the QueryOpenDatabase may not be positioned where you can actually pull this off. The "Query" part sometimes means that the database hasn't been opened yet ... in which case, there's no target out there to point to.

I remember having trouble with this.

You may need to move to the frameset, where you can select the frame being opened using @functions.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal