I have a view of parent and response docs in hierarchy, what I am trying to achieve is if the user double clicks a response doc, the parent doc is opened instead(the parent has an embedded view of responses).
I have tried using some LS in the Queryopendocument to switch the docs but when the parent doc goes to open it triggers the Queryopendocument event again and I end up stuck in some kind of loop which results in a “Script Stack Overflow” error.
Here is my code:
Dim s As New Notessession
Dim ws As New NotesUIWorkspace
Dim dc As NotesDocumentCollection
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim mainDoc As NotesDocument
Set db = s.currentDatabase
Set dc = Source.Documents
Set doc = dc.GetFirstDocument
If doc Is Nothing Then
Exit Sub
Elseif doc.IsResponse Then
Call source.DeselectAll
Set mainDoc = db.GetDocumentByUNID(doc.ServReqUNID(0))
Set doc = Nothing
Call ws.EditDocument(mainDoc)
End If
I’m trying to avoid putting the code into the Queryopen event of the form as I still want to be able to open the response doc outside of this view.
Has anyone accomplished this before or know how to?
Cheers…