Subject: RE: @SetTargetFrame and Composing a Response Doc From an Action in a View
You are facing a battle in that Notes does not think you have a document selected in which to create a response. The workaround is to create it using LotusScript:
Action Button on Form calls agent:
@SetTargetFrame(“main”);
@Command([ToolsRunMacro] ; “(Create Something)”)
Agent code:
Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As Notesdatabase
Set db = session.CurrentDatabase
Dim uidoc As NotesUIDocument
Set uidoc = ws.CurrentDocument
Dim parentDoc As NotesDocument
Set parentDoc = uidoc.Document
Call CreateResponsedoc(session, db, ws, parentDoc)
Sub CreateresponseDoc(session As NotesSession, db As NotesDatabase, ws As Notesuiworkspace, parentDoc As NotesDocument)
Dim responseDoc As NotesDocument
Set responseDoc = db.CreateDocument
Call responseDoc.MakeResponse( parentDoc )
responseDoc.Form = “FormName”
'Set your field values here if needed
…
Call responseDoc.Save( True, True )
Call ws.SetTargetFrame( “main” )
'Put the response document on the Front End
Call ws.EditDocument( True, responseDoc )
This will take care of your difficulties (at least it did for me:-) )