Domino Web Application - Updating a Field on a document in read mode

Hi all

I have a domino web application in which I want to capture user logging details(username) and update that on a field on the form called "currentuser", however this has to happen when the document is in read mode as all users are allowed to open the document only in Read Mode

I know that you're not able to update a field on a document in Read Mode, but I was under the impression that something like this can be done in an Ajax agent but I am not sure how to do it.

Any ideas or solutions to this issue will be much appreciated

varvoura

varvouraAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Bill-HansonConnect With a Mentor Commented:
You can use Ajax, a WebQueryOpen agent, or a <Computed Text> element.

Depending on what you are using this for, the simplest method is to use a <Computed Text> element that will display the current user's name.  Since this is not a field, there are no restrictions for updating the display.

If a computed text element is not robust enough for your needs (it would help to know why you need this), then I would try using a WebQueryOpen agent next.  Just use LotusScript to set the item value.  The important thing to remember is that you can update the value of an item regardless of whether the document is in read- or edit-mode.  You will get an error, however, if you try to save a document that is in read-mode.  I use this technique in Notes client forms all the time; using the form's QueryOpen event to set backend read-only data.  The same concept will work using WebQueryOpen.

AJAX would require the most setup, and is only required when you need to update a part of a page (to prevent reloading the entire page).  It sounds like all of the data you need is available when the page loads, so the code really should go in WebQueryOpen (unless the computed text element works).
0
 
daj_ukConnect With a Mentor Commented:
You could write an Agent that runs on the server and updates the document prior to it being sent to the user.  I assume the server (or signer of the Agent) would have Edit access?
0
 
varvouraAuthor Commented:
Hi Bill,

Great answer, I did the exact same thing yesterday before I saw your post.
I created a WebQueryOpen agent to populate a the username in a computed for display field. This then helped me to create profile docs for all those users that opened the documents(still in the webqueryopen agent).
Then I created a second scheduled agent where I am the signer of it and i have full rights to all the documents to update and save the user data on all the documents using the data in the profile documents

Many thanks to you both
varvoura
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.