I have a frameset and on it I have a frame. In this frame I have a new document. On this document I have a save button.
What I want is when I hit the button it saves and closes this document and opens a new UI document of the same form in the same frame.
As it is now I get the “ancestor” error, and I can understand why, but I can not figure out what to do about it.
Using ws.SetTargetFrame immediately after Dim ws As New NotesUIWorkspace did not work. Again understandably.
— LS code from button —
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Call ws.SetTargetFrame("frameNewDoc")
Set uidoc = ws.CurrentDocument
Call uidoc.Save
Set uidoc= Nothing
Call ws.ComposeDocument( "", "", "formDoc" )
Subject: Notes Error - Target frame is ancestor of script object
There is an optional parameter on the ComposeDocument method to return the NotesUIDocument object. Try setting that to false and see if that stops the error from occurring.
Subject: Notes Error - Target frame is ancestor of script object
Have you tried using formula language? You can pull this off in formula language by using @SetTargetFrame. I use the technique to bring up pages that say whether the submission was successful or not…