We have a form that has an agent being triggered in the WebQuerySave. The document gets saved before the agent runs. What would cause this to happen. I thought the agent would finish and then the document will be saved.
The reason I ask this is because the agent is supposed to update the previously saved document. The new document gets save prior to the agent running and updates that document.
Thanks in advance.
Subject: More info?
You don’t mention what you have or haven’t looked at or tried so they may seem basic, but here’s a couple of questions:
Are you sure the agent you specified in WebQuerySave is actually found and being run? (using any print or msgbox statements to see in the log?)
Is your agent set to the right trigger and selection so that it can run?
Is there security or “Hide From” properties set on the agent that would prevent the HTTP task from finding it?
Is there a doc.Save in the agent code near the beginning? Btw, this is generally a bad idea.
Subject: Reply
It is located in the WebQuerySave.
The agent runs properly, its just that the document for some reason saves before the agent finishes running.
Nope
There is a save of a document that is retrieved about halfway through. There is also a look up. Could that slow things ?
Subject: Document Saves
The document seems to save prior to the agent running. In the help it states, “The document is automatically saved after the agent runs.” This doesn’t appear to be happening.
The agent retrieves the first document in a view and updates a status field. After this update the web document should be saved and then will be the first document in the view. My problem is that it seems that the agent retrieves the web document. It’s like the web document saves prior to the WebQuerySave agent is comeplete.
Not sure if this makes any sense, but your help is appreciated.
Subject: A .Save was the Problem
It appears that if you have a save, even if it doesn’t explicitly say save the current document, it will save the web document. I changed the position of the Lookup and everything is fine.
Subject: Just seeing these replies now
Just getting to have a little downtime since my question yesterday to check the forum and saw your replies.
One problem in addition to not telling us anything about what you tried for troubleshooting or a specific situation is you never provided any code sample for anyone to examine.
I’m pretty sure I’ve saved other docs in WQS agents without causing the submitted doc to save. Are you sure you were calling save on the right Notesdocument instance? That is something another set of eyes on the code might have seen.
Subject: There is a Save - Solution
There is a save. I didn’t take into account the agent was using DocumentContext. Well via the web this is the web form. They are manipulating the DocumentContext and saving it. The code to search for the previous form was placed after the save. I just moved that code to an appropriate position.
All is working properly now.
Thanks for the help