Pass parameters using RunOnServer agent

I am trying to utilize RunOnServer agents to pass parameters between agents. The first agent (called from the document) creates parameter document and calls RunOnServer agent. RunOnServer agent accesses parameter document, does search using ODBC connections and updates parameter document and saves it. The problem that I have is when RunOnServer agent finishes the first agent can’t find updated fields (updated by the RunOnServer agent) - fields don’t exist yet. But when I finish the task and check the parameter document the fields are there. Is there any caching there? Any suggestions?

Thanks in advance

Robert

Subject: close and re-open

In the code that calls the agent, are you closing and re-opening the parameter doc? I could be wrong, but I don’t believe the agent that writes to the parameter doc will update the in-memory copy of the parameter doc that is already open in your initial code.

Subject: Is there a close method?

I don’t know of any close methods for the notesDocument class. When RunOnServer agent finishes its task I “reopen” parameter doc again.

Robert

Subject: Try Delete…

  1. Save your parameter document.2. Capture NID.

  2. Delete your document object. Not your document, but the NotesDocument object reference to your document.

  3. For overkill set your document object to null, if LS will let you. Sometimes it does.

  4. Call your agent with the NID.

  5. Set your document object by the NID.

  • You should have your data now.

  • I’ve done this dog and pony show so often I’ve written a class to obfuscate it for me.

  • For Java the process is similar, but you must must must recycle() before step 3. And setting to null is insurance, not overkill.

Hope this helps…

Subject: Solved

Thanks for your help.

Delete docReference did the trick.

Robert

Subject: I am trying the same and having no luck

Hi,

Trying the same and not able to get it to work. Can you post the code on how you got it to work.

Please and Thank You In Advance

Subject: already documented…

Subject: hmm

Hmm…the re-open is what I was getting at. After re-open, that should see any changes to teh document from the agent.