Scheduled agent cannot update profile document?

I run agent manually, it can update some fields in profile document. But when the agent runs scheduled, it did not update fields in profile document. Any idea?

Subject: RE: scheduled agent cannot update profile document?

You forgot to say whether the agent runs with any errors and if so, what the error text is.

Profile documents are cached in your Notes client for efficiency. When you run an agent locally and update the profile document, it affects your local cache as well as updating the document. When the server runs an agent, it updates the document, but the server cannot update your local cache, and your Notes client doesn’t check the profile document to see whether it’s changed (that would defeat the purpose of a cache). You can see the changes the server agent made, by exiting and restarting Notes.

Subject: RE: scheduled agent cannot update profile document?

The agent runs without any errors in my local mach. I have three scheduled agents to run three separate documents. Two of them are not profile document, the scheduled agents runs OK for the non-profile documents with updating field value. But 3rd scheduled agent runs OK for the profile document, but did not change field value in the profile document. I tried profiledoc.fieldname = newValue or set item = profiledoc.replaceitemvalue( fieldname, newvalue) both, but the agent never change field value in profile document as scheduled. If I run the agent manually, the agent did change field value in profile document… that is weird. Any idea?

Subject: RE: scheduled agent cannot update profile document?

I don’t think you read all of my message.

You can see the changes the server agent made, by exiting and restarting Notes. The Notes client caches the profile document, so the Notes client doesn’t notice immediately that the server made a change to that document.

If that is not your problem, read on.

When we talk about error messages, naturally we’re interested to know about errors in the case where the process failed, not where it succeeded. Therefore it’s the server run that we need to know about.

The statements you are using to set field values in the profile document are fine. But how are you getting the profile document, and how are you saving it?

Subject: RE: scheduled agent cannot update profile document?

Yes. the scheduled agent can get value from fields in profile document, but it never change field value in profile document automatically. I have profiledoc.save(true, false).

Subject: RE: scheduled agent cannot update profile document?

I don’t bother to repeat my points a third time.

Subject: RE: scheduled agent cannot update profile document?

I know your point: “You can see the changes the server agent made, by exiting and restarting Notes. The Notes client caches the profile document, so the Notes client doesn’t notice immediately that the server made a change to that document.” I will wait to see the changes. Thanks for your help and ur time.

Subject: RE: scheduled agent cannot update profile document?

In addition to Andre’s points you will find additional information on profile documents and its uses (and when not to us eit) in the Agent FAQ under resources.