@username not recalculating on web doc

I have a form with a computed hidden field called ‘username’. It’s formula is @username. The document is created via lotuscript. When I open the document from the browser side, the value of ‘username’ is the ID that created the document. The value doesn’t change until I save the document, at which point the value changes to the ID of who’s logged into the IE session.

I’m doing the save via a pass-thru html button that calls a javascript procedure. I have tried putting window._doClick(‘$refresh’,this,null);in those procedures, but then the form doesn’t close after it has been saved.

A couple of other things to note:

– There aren’t any editable fields on the form when the user clicks on this button - that’s all I want them to have to do.

– Automatically Refresh Fields is ‘checked’ for this form.

– Generate HTML for all fields is also ‘checked’

– REMOTE_USER is also a field on the form and it doesn’t display a value until it has been saved on the web. Seems like that should fill in every time you open a doc from the browser - at a minimum it should fill in when you put it in edit mode.

I have also tried using @eval(@username)in a computed field but that value only gets set once.

Any ideas would be appreciated.

Subject: So what do you WANT to happen?

Subject: I want the name of the current user to show up in a field I can use

I want a way to grab the name of the current user so I can record who clicked on the HTML buton. Remote_user should have it.

@username in the Username computed field should have it, too.

But Remote_user is blank until the doc is saved the first time from the web and the computed field Username shows the name of the last editor - until after you’ve saved the document.

Right now the hokey solution is to use Remote_user if it has something in it and if it doesn’t, use the value of @eval(@username)).

Subject: Use a WebQueryOpen agent

Add a WebQueryOpen agent and set the desired value of the Username field there.

Subject: RE: I want the name of the current user to show up in a field I can use

Use a computed-for-display field or computed text. They both evaluate for new docs and docs in read mode. You can make the value available to JavaScript using something like this in passthru:

You can also do pretty much the same thing in the HTML Head Contents formula.