Agents runs in debug but not when turn off

I have an agent that is called on a button. The button does 2 things it sets fields on the form to canceled and it also then calls another agent. The other agent then adds back in hours and sends an email. The problem is that this agent run great when I have debug turned on but gives the following error “Unable to find Document Window” when debug is turn off. It errors out after it set the fields to canceled. Any suggestions would be appricated.

Subject: Agents runs in debug but not when turn off

Hey, Kim!

Hmm… not sure. What are the triggers for the two agents? “On Action Menu” & “All Selected Documents” or what? I’m not sure if this helps, but the problem might be there.

If you have one agent that does something to a document, then calls another agent that does something else to the same document, you may get something like this, methinks. Instead of two agents, why not one agent that does all of this? The script in the 2nd agent could be put in a script library or something.

HTH! :wink:

Steve in NYC

“The Law of Cybernetic Entomology: There’s always one more bug.”