Compose doc with Fieldsettext

I’m trying to compose a new document and populate one of its fields with input from the user.

I have the following code on the Click event of an View’s Action button:

Dim workspace As New NotesUIWorkspace

Dim askme As Variant

askme = workspace.Prompt(PROMPT_OKCANCELEDIT, “Enter Grid”, “Enter the Grid # in the box below:”)

Dim uidoc As NotesUIDocument

Set uidoc = workspace.ComposeDocument( “”, “”, “Entry” )

Call uidoc.Fieldsettext(“BaseGrid”, askme)

But I get this error message:

“You must be in edit mode to change the value of a field”

I tried adding:

 uidoc.EditMode = True 

but then I get “Document command is not available”

Can anyone help?

Subject: Compose doc with Fieldsettext

I usually do it a little different.

First compose the backend document using

Set doc = db.createdocument

Then, set the field values:

Doc.BaseGrid = askme

Then use, Set UIDocument = UIWorkspace.EditDocument(True, Doc) to open the document for the user.

Subject: RE: Compose doc with Fieldsettext

This works a lot better! On to the next one…Much obliged,

Elli