A response form being created as a main

I have a form… that sometimes needs to be a response to a document and sometimes needs to be a main document.

So, I thought, no big deal… I’ll make it a document form type and then use the .makeresponse method when I need it to be a response.

Of course, I have seen the error of my ways, and when my document is saved later, the $Ref field is removed and it becomes a main document…

So, I thought, fine, I’ll define my form as a response instead of a document…

Then the respones part works great…

Now, if I want to create document as main documents using this form design, I thought, hmmm… I can just delete the $Ref.

So, I thought, I’d create the document on the back end and then bring it to the front using the following code called from an action button in a view:

Dim Session As New NotesSession

Dim db As NotesDatabase

Dim Workspace As New NotesUIWorkspace

Dim uidoc As NotesUiDocument

Dim Doc As NotesDocument



Set db = Session.CurrentDatabase

Set doc = db.CreateDocument

With doc

	.form = "LOE"

	.from = Session.UserName

	.requestType = "LOE"

	.saveoptions = "1"

End With

Call doc.save(True,True,True)

Set uidoc =workspace.editdocument(doc)

Call doc.removeitem("saveoptions")

When I envoke the code, and I use debugger, I can see the document being created. But when I try to bring it to the front user interface with teh workspace.editdocument(doc) call

it opens the document from the view that I am sittiong on…

Any clues as to what I should try…

Thanks in advance…

Subject: A response form being created as a main.

You could create a subform with all the fields on and then insert the subform on two forms one of which is a document and the other a response.

Subject: A response form being created as a main.

My kneejerk reaction:

Make another form, a response form, that looks EXACTLY like your main form. Same fields, etc.

Difference is, it is a response form. Now compose a document using that new form whenever you need a response, and use the main form for main docs. If they look exactly like each other, the person using it will not know the difference.

Does that theory hold water?

  • Matt