Webquerysave agent?

Hi all,I’m trying to get a simple agent to work on the web, it is lotuscript, called from the webquerysave event. It works in the client only if it is in the post save event, otherwise I get an error saying the doc must be saved.

The agent does not get nor reference the current document (or document.context). I was testing it with the following initially, and still getting the error:

Dim s As New NotesSession

Dim db As NotesDatabase

Dim newmaildoc As notesdocument



Set db = s.CurrentDatabase

Set newmaildoc= db.CreateDocument

newmaildoc.form="Memo"

newmaildoc.subject= "test"  

newmaildoc.sendto="CHall@xxxx.com"

Call newmaildoc.Send(False)	

Any ideas what I’m missing on this.

Subject: webquerysave agent ?

Hi,

Try this code, as on web you cannot access the notes uidoc directly.

Dim session As New NotesSession

Dim db As NotesDataBase

Dim docSource As NotesDocument 

Dim docMail As NotesDocument

Set db = session.CurrentDataBase	

Set docMail = New NotesDocument (db)

Set docSource = session.DocumentContext 

Regards,

Atul A.

Subject: RE: webquerysave agent ?

thank you Atul, I appreciate the response.

I did not have the agent property set to run on all documents in the database.

Thanks,

Chris