@SetTargetFrame and Composing a Response Doc From an Action in a View

have an application within frames in R6, and am trying to create an action button which, when a document is selected and the action button clicked, will create a response document in the designated frame. This should be easy, as I thought I’d just do something like:

@SetTargetFrame(“Right”);@Command([Compose];“Response”)

However, the @SetTargetFrame command seems to nullify the selected document and an error is returned that “No Document is Selected”.

This is on Windows 2K

Ideas?

Subject: @SetTargetFrame and Composing a Response Doc From an Action in a View

Is the button in the outline or in the view/document?

Subject: RE: @SetTargetFrame and Composing a Response Doc From an Action in a View

The Action button is on the document.

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:-) )