RE: RunOnServer apparently not running Stan Rogers 1.Nov.12 01:50 PM a Web browser Domino Designer 6.0.3Windows XP
The parameter document is passed by NoteID, not by UNID. That may not be your immediate problem, but the two ID strings are differently configured (the NoteID is essentially a sequential number, while the UNID (as a string) is a pair of time stamps glued end-to-end, and their expected lengths won't match). That wouldn't matter with LS, but remember that the code you're actually using was written in C or C++, so string length for something with an expected format does matter (whether it'll raise an error or just be truncated, I don't know, but it needs to fit in the char array allotted). If the agent can't get the param doc because of the mismatch, it can't delete it, and you'll be stuck in the "get the param doc" loop forever in the action.
Speaking of which: if you've got a handle on the param doc in the action, how is the agent supposed to remove it? There's only a very small window of opportunity between releasing and grabbing the document handle again. That's likely why it works when you step thrugh the code, but not if you let it run freely -- you're creating a race condition. Try adding a short sleep between releasing the document and picking it up again. A small fraction of a second (say 250ms, which would be 0.25 in the Sleep statement) is an eternity for the computer but all but imperceptible to the user.
Oh, and you can use:
Set docParam = Nothing
It shouldn't have any performance implications here, but it's a little tidier. (In more complex code, it can free up a lot of memory if you Delete objects when you're done with them.)