Target Frame

Hello,

I’m developing an application on college at the moment, and I’ve came to a bit of a problem here.

I’ll shortly describe my problem:

I’ve created a frameset called “RotRbsFrameset”. In this frameset I defined five frame’s. The content frame is called “NotesView”, I want all my views, documents etc to open in this frame.

So, I’ve inserted a company in my database, which I open afterwards, there is a button on this form. Once I hit this button, it has to open a new form in the same frame, NotesView. The problem is, that, once I hit the button, it opens in a new tab. I’ve tried about everything, so I’m asking for your help now.

Once I add the code: Call workspace.SetTargetFrame(“NotesView”) I get the error: “Notes Error - Target frame is a ancestor blabla”

I’ve searched on this forums for the solution, but havn’t found the solution yet.

Here is the code for the action button:

Sub Click(Source As Button)

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim db As NotesDatabase

Dim doc As NotesDocument	

Dim id As String

Dim uidoc As NotesUIDocument

Dim uidoc2 As NotesUIDocument



Set db = session.CurrentDatabase

Set uidoc = workspace.CurrentDocument

id = uidoc.FieldGetText("RotRbsBedrijfID")

Set uidoc2 = workspace.ComposeDocument("", "", "RotRbsFormContactBedrijf")	

Call uidoc2.FieldSetText("RotRbsFormContactBedrijfID", Cstr(id))

Call uidoc2.Refresh

End Sub

Thanks in advance,

Stephan

Subject: Target Frame

Try placing your LS code, along with the SetTargetFrame, into an agent. Then in your button, call that agent using @Command([ToolsRunMacro]). That should get you around that error.

Hope that helps

Subject: RE: Target Frame

Hello Wing,

I’ve tried this aswell, it got me around the error yes, but, it still didn’t open the new document in the frame, it opens in a new tab instead.

All my targets are pointing towards the NotesView frame, but the weird thing is, that this error only occurs when I point my LotusScript towards the NotesView frame, when I point it towards my top frame, it works fine. Although it doesn’t have to do anything with the frame name, since i changed the frame name etc and the same error occured.

I hope anyone got the solutions,

Thanks in advance,

Stephan