Problem with saving new document on web

When I save a new document on the web, instead of redirecting to the newly saved document (with seq=n), I get a “page not found” instead. It also ignores my $$Return field. If save an existing document, there is no problem at all.

I am using a formula submit button (FileSave/FileCloseWindow) and the “use Javascript when generating pages” option. There is no web query save agent specified and nothing in the server logs. I don’t remember ever having this problem before. Any ideas? Thanks.

Subject: Problem with saving new document on web

Using @Command([FileSave]) AND @Command([FileCloseWindow]) should not take you to the same document, but should really close it. If there is no $$Return item, I would expect it to show Form processed, though.

(Edit: No, that’s what takes you to the database start page.)

If you want to keep editing the same doc (with appended/updated Seq no), simply omit the second @Command.

Subject: RE: Problem with saving new document on web

Okay, that makes more sense.

I found that I get the 404 error if I specify a relative URL in $$Return. An absolute URL or plain text works fine. I didn’t realise this limitation existed.

I actually expected to see “Form processed” initially. When does this message occur?

Subject: RE: Problem with saving new document on web

Relative URLs are just fine in $$Return, but watch out where a relative link takes you.

Problem is (most of the time), that the virtual directory structure for opening a document is one level deeper that for opening a form (because of the view). I prefer to make all my links relative to the host name like

"[/ + @WebDbName + “/MyForm?OpenForm]”

"[/ + @WebDbName + “/MyView?OpenView]”

"[/ + @WebDbName + “/0/” + @Text(@DocumentUniqueId) + “?EditDocument]”

Subject: Problem with saving new document on web

What’s the address of that “page not found”.- maybe a formula-error in the $$Return ?

Subject: RE: Problem with saving new document on web

The URL on the 404 is “http://my-server/my-db.nsf/my-form?OpenForm&Seq=1”. Looks ok.

However, if I leave the $$Return field blank, on save the window redirects to the database home. eg. http://my-server/my-db.nsf.

Not sure what the problem is. My $$Return value is just a straight URL string surrounded with square brackets.

Subject: Problem with saving new document on web

Are you trying to have it return to the same document, opened and in read mode? Or to an appropriate view w/ it highlighted?

Subject: RE: Problem with saving new document on web

“Or to an appropriate view w/ it highlighted?” - Is there a Domino feature that does this automatically? Or do you need to write the URL yourself (eg. view query)?

Subject: RE: Problem with saving new document on web

Yes, you have to create an appropriate view URL command yourself. No one-click feature, but not hard to do.