I am trying to have the following agent run as a querywebsave agent, but when I do nothing happens (document does not get saved and the agent does not run). I don’t even get the ‘Document Processed’ message, it just goes to the default webpage for the application. I have done this a zillion times but I cannot figure out WHY it is not working this time!!! Help…And I know it has something to do with the agent because ifI don’t call it from the webquerysave, the document gets saved.
Form has 2 fields, lastname and netid (simplified to the barebones to try to resolve this issue) and submit button with a filesave and fileclosewindow command
agent = welcome
trigger = action menu selection
webquery save on the form has @Command([ToolsRunMacro]; “welcome”)
And the agent looks like this
Sub Initialize
Dim s As New NotesSession
Dim memo As NotesDocument
Dim note As NotesDocument
Dim db As NotesDatabase
Set db = s.CurrentDatabase
Set note = s.DocumentContext
Set memo = New Notesdocument(db)
If note.netid(0) <> "" Then
memo.Form = "Memo"
memo.Principal="xxxx@uic.edu@NotesDomain"
memo.SendTo = note.netid(0)
memo.MailOptions = "1"
memo.Subject = "Welcome to UIC's FaCT Computer Program "
tmpstring = "Hello, " + note.lastname(0)
paragraph1 = " paragraph1"
paragraph2 = "paragraph2"
paragraph3 = "paragraph3"
paragraph4 = "paragraph4"
paragraph5 = "Thank you"
paragraph6 = "--- xxxx@uic.edu"
paragraph7 = " http://myurl"
Set memobody = memo.CreateRichTextItem("Body")
Call memobody.AppendText(tmpstring)
Call memobody.Addnewline(2)
Call memobody.AppendText(paragraph1)
Call memobody.Addnewline(2)
Call memobody.AppendText(paragraph2)
Call memobody.Addnewline(2)
Call memobody.AppendText(paragraph3)
Call memobody.Addnewline(2)
Call memobody.AppendText(paragraph4)
Call memobody.Addnewline(2)
Call memobody.AppendText(paragraph5)
Call memobody.Addnewline(2)
Call memobody.AppendText(paragraph6)
Call memobody.Addnewline(2)
Call memobody.AppendText(paragraph7)
Call memo.Send(False)
End If
note.newfaculty="no"
Call note.save (False,False)
End Sub
The agent runs fine if I run it against an existing document in the DB from the actions menu.
What am I doing wrong? This is driving me crazy!
Thank you in advance
Cynthia