< Back

Document Subject: How to tell if a document is new in a Web Query Save agent
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#IsNewNote or http://A555F9/nn.nsf/ByAlias/IsNewNote

May be you want to send out an email if the document is new, bit not if it is revised. Easy one but got asked it again today.




Just use isnewnote .

 

Set s = New NotesSession
Set doc = s.DocumentContext

Set db = s.CurrentDatabase

Dim maildoc As New notesdocument(db)
maildoc.Form = "Memo"

Dim rtitem As notesrichtextitem
Set rtitem = New NotesRichTextItem(maildoc, "Body" )

If doc.IsNewNote Then
 Call rtitem.AppendText("Below is a link to a new document in the Database.")  
Else
 Call rtitem.AppendText("Below is a link to a revised document in the Database.")
End If

 

In a WQS agent you do not need to save the context document, it will be done automatically.

It is best to call a WebQuerySave agent (WQS<formname>) to make it east to find.