?ReadForm and submit with ?CreateDocument - recomputes?

I have a form, content-type HTML, that I access with ?ReadForm. It all works great. Now I want to add a computed field, to generate a key. It comes up with a ?ReadForm just fine, I use it for some stuff on the form and it works fine. Once I hit submit (?CreateDocument), the form reloads itself somehow in the background, and the key has recomputed to something else on the resulting Notes document :frowning:

I think this is related to the problem I was having with $$Return here .

When you open a form with “?ReadForm”, why does it silently recompute when you submit it with “?CreateDocument”? Am I doing something wrong?

Since this is the way it seems to work, can anyone help me find a way to compute a unique key at “?ReadForm”, and have that same value still available after “?CreateDocument”?

This comes from my attempt at having a file upload on my HTML form without using Notes generated content . I am pretty much done setting up the solution found here:

http://www.vincedimascio.com/vince/vpd.nsf/all/113A7631B85BA6578825723A007A27F2

But if I can’t have a persistant unique key, I can’t get the attachment put into the resulting Notes document! Any other ideas on how to get a file upload working with hand crafted HTML would be very appreciated, if there is no way to finish off what I have so far. Man I’m punishing myself trying to do this stuff by hand!

Subject: ?ReadForm and submit with ?CreateDocument - recomputes?

You could pass it as a parameter

?CreateDocument&key=whatever

This article on codestore may help.

http://www.codestore.net/store.nsf/unid/EPSD-5D6R6R?OpenDocument

Subject: thanks, that helped…

Changed the code for my computed DocumentKey field from basically:

@Unique

to:

PassedIn := @URLQueryString( “Key” );

@If( PassedIn != “”; PassedIn; @Unique );

then changed my Submit action from:

?CreateDocument

to:

?CreateDocument&Key=

where computed value is

DocumentKey

Now when you do a plain ?OpenForm to start one, it computes, and then when you hit Submit, it passes it along and it doesn’t recompte.

A little annoying, but not too complicated. I still feel like there might be a simpler way if I just had a better understanding :frowning:

Thanks again!