@command compose and @setfield value

Hello All,

I’m trying to preset a field value on a new docuement by using @command compose and @setfield.

Here is the code, but the field is not getting set to the value.

@Command([Compose];“”;“My form”);

@SetField( “My fields” ; “Fix” )

It’s important that the created form be in uidocument mode so I can use the querysave event for further processing.

Subject: @command compose and @setfield value

hallo

maybe the focus is not on the new created document so the @setfield can not access the document. try @UpdateFormulaContext between the @command compose and the @setfield.

michael

Subject: @command compose and @setfield value - got it

I was using the db.createdocument method instead of this…

Sub Click(Source As Button)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.ComposeDocument _

( "", "", "Project Task" )

Call uidoc.Fieldsettext("Type", "Fix")

End Sub