I have an eventsdatabase (webapplication) where on saving an event some people must receive a mailnotification with an url-doclink.
When saving an event in web, the agent (in WebQuerySave) does not work. Even the event will not be saved.
When saving an event in the notesclient AND running the agent (in QuerySave) everything works perfect.
What do i wrong?
An someone help me please?
Thanks.
I call the agent with this command;
([ToolsRunMacro]; “SendAnnouncementNotify”)
The code in the agent is the Following;
Sub Initialize
Dim ws As New NotesSession
Dim doc As NotesDocument
Dim db As NotesDatabase
Set doc = ws.DocumentContext
Set db = ws.CurrentDatabase
Dim AnnounceSendTo As String
Dim AnnounceFrom As String
Dim AnnounceSubject As String
’ Dim fieldinfo() As String
Dim UrlDocument As String
UrlDocument = doc.EvUrlDoc(0)
Dim email As NotesDocument
Set email = New NotesDocument(db)
email.Form = "Memo"
AnnounceFrom = doc.EvCreatedBy(0)
AnnounceSendTo = doc.EvReaders(0)
AnnounceSubject = doc.EvDescription(0)
email.SendTo=doc.EvReaders(0)
email.Subject ="A new event was submitted by " + " which requires your attention"
email.SaveMessageOnSend = True
Dim bodyItem As NotesRichTextItem
Dim object As NotesEmbeddedObject
Set bodyItem = email.CreateRichTextItem( "Body" )
Call bodyItem.AppendText( "*****************************************************************************************************")
Call bodyItem.AddNewLine( 1 )
Call bodyItem.AppendText("* DO NOT RESPOND TO THE SERVICE MACHINE THAT GENERATED THIS NOTE *")
Call bodyItem.AddNewLine( 1 )
Call bodyItem.AppendText( "*****************************************************************************************************")
Call bodyItem.AddNewLine( 1 )
Call bodyItem.AppendText("An event was created")
Call bodyItem.AddNewLine( 1 )
Call bodyItem.AppendText("It was created by: ")
Call bodyItem.AddNewLine( 1 )
Call bodyItem.AppendText("You may read the annoucement by clicking on the link below.")
Call bodyItem.AddNewLine( 1 )
Call bodyItem.AddNewLine( 1 )
Call bodyItem.appendText(UrlDocument )
email.Send( True)
'@Command
End Sub