Obviously this is a bit weird for a tueday afternoon when you are half asleep to see a server run bit of code pop up a dialog box in the web browser.
It is pretty obvious:
On error goto eh
'<do normal stuff in agent >
Print "[/" + web.path + "/0/" + doc.UniversalID + "]"
Exit Sub
eh:
Print |<script>alert('Error: | + Cstr(Error) + | on line | + Cstr(Erl) + | (wqsRequest)')</script>|
End
Bascially the agent is just squirting out some javascript code with the alert code.
I prefer to do it as a normal message with a link "back" to the document, or to the last view so as not to scare the user too much:
Nb the [/url] is a trick for displaying a page at the end of a wqs. It is the WebQuerySave way of doing a $$Return.
NB: always best to prepend the names of webquerysave agents with WQS to make them easy to find eg WQSrequest or WQOrequest