To read mode from edit mode on web

This seems really basic, but I can’t seem to find a good solution in Notes help or in forum searches.

I have a document open on the web in edit mode. I am trying to program a simple “discard changes” button that takes me back to read mode for the current document.

@Command([EditDocument]; 0) won’t work because the parameters are ignored on the web.

@Command([OpenDocument]) seems to re-open the document, but in edit mode again (also tried this with a “zero” parameter - no luck).

Trying:

@Command([OpenView]; “LookupView”; “”);

@Command([OpenDocument])

Now this should work, however I keep getting an “entry not found in index” error, despite the fact that I know the UNID value is listed in the first column of the view, which is sorted. Grr!

Do I have to go to Javascript to manipulate the location.href directly? I hate using Javascript to do something that Notes will do natively.

I’m looking for a simple way to return to read mode or some suggestions on what to look for on the “entry not found in index” problem with OpenView->OpenDocument.

Thanks all!

Subject: To read mode from edit mode on web

Wouldn’t a link do? I hate to POST a processing request to a server to replicate a GET the browser does natively. And I REALLY hate to use buttons for GETs – nearly as bad as using links for POSTs. If you absolutely have to use a button, use @URLOpen:

@URLOpen(“/” + @WebDbName + “/” + @ViewTitle + “/” + @Text(@DocumentUniqueID) + “?OpenDocument”)

Subject: RE: To read mode from edit mode on web

Thanks Stan - that was a real eye-opening response. I never even considered the Get vs. Post aspect. I went to a link hotspot instead of a button with the same code you provided for the @URLOpen. It works beautifully and is more elegant in design.

There are several places in my navigation scheme where I can apply this technique. Beautiful!