Posting a form from lotusscript

Hi Guys,

Wondered if anyone knew if it was possible to (using a webquery save agent) to construct a form with field values and then post this form without actually loading the form (i.e. Printing the form to the browser).

Any help would be appreciated thanks.

Aden

Subject: Posting a form from lotusscript.

If I understand what you’re asking you just want to create a document in the backend? Therefore in your QuerySave:

Dim s as New NotesSession

Dim thisDB as NotesDatabase

Dim newDoc As NotesDocument

Set thisDB = s.currentDatabase

Set newDoc = ThisDB.CreatedDocument

With newDoc

.Form = "FormName"

.FieldName1 = "hard code"

.FieldName2 = SrcDoc.AnyField(0) ' If just a single value

....

End With

Call newDoc.Save(False,False)

IF you wanted you could also then get the documents ID and display this form if you wanted.

What I wasn’t sure about is if you mean design the form also?

Subject: RE: Posting a form from lotusscript.

No not quite Stephen.

Sorry I failed to mention that I need to post the form that I will be constructing in Lotusscript to another URL, Meaning that a third party company will be parsing my field values.

Thanks anyway though :wink:

Subject: RE: Posting a form from lotusscript.

I don’t know of a quick and easy, platform independent way to do this in LotusScript alone. A LotusScript agent can only output HTML (as response to a get request) or make the browser client request a different resource through a redirect (which will result in another get request).

Some might consider the nasty stuff (like printing out a complete website with a form that has all the necessary fields, a post action and some ugly JavaScript onload, that would submit the form immediately). Nah, we don’t want to do this.

What you need is a programatically accessible http client (which you can get, just not in native LotusScript). Luckily, whenever you think that someone should have build a tool to use that in Domino, this very someone has done it already: Some call him Julian, other’s know him as Mr. Been-there-done-that, God might simply call him “ol’ pal”:

http://www.nsftools.com/blog/blog-05-2007.htm#05-22-07

Could be just what you need, although I haven’t tried it myself, yet.