within a discussion thread and email a notification to only the participants of
that thread. It is a little long but it works great!
First on the Main Discussion form create two fields. Field One will be text,
computed with the formula @Text(@DocumentUniqueID) This is used to locate the
parent and modify the list. Field two will be text, computed with the formula
Next create a hidden view with the first column sorted and set to Field One
from the main form. This is used later for the parent lookup.
Now on the Response and Response to Response forms create three field. Set the
form defaults to formulas inherit values from selected document. They are the
same on both forms. Field one will be named the same as field one on the main
form text, computed and the value will be set to itself. Field two will be
named the same as field two on the main form text, computed, allow multi-values
selected with the formula @Unique(@Explode(@DbLookup( "" : "NoCache" ; "" : ""
; "docbykey" ; Parid ; "NotifyList" );",")) Field three will be text, computed
with the formula @Name([Abbreviate];@UserName) This captures the Response
In the PostRecalc Event goes this formula
This is used to insure that there are no duplicates in the Notify Field
Finaly in the query save event of the for goes this script:
Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim workspace As New notesuiworkspace
Dim parent As notesdocument
Dim newDoc As NotesDocument
Dim ModifyNotificationlist As Variant 'Name of value to replace parents
Dim rtitem As NotesRichTextItem
'Process to replace existing notification list on parent
Set Source = workspace.currentdocument
Set db = session.CurrentDatabase
Call Source.refresh 'Refresh the doc before getting the new notify list.
This insures that a persons name is only in the list once.
ModifyNotificationlist = Source.fieldgettext("notifylist") 'This is the
field that contains your list of people to be notified
docid = Source.fieldgettext("parid") 'Name of field storing the parent
Set view = db.GetView("docbykey") 'Get view to find parent
Set parent = view.Getdocumentbykey(docid) 'Find parent by docid stored
in parid field
existing notify 'list with new list
'Start to compose the email notification message. All field named here
are on response form. Or coarse your names may very.
Getauthor = Source.fieldgettext("From")
GetSubject = Source.fieldgettext("OriginalSubject")
Set newDoc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( newDoc, "Body" )
Call rtitem.AppendText( getauthor &" This is author and message you want")
Call rtitem.AddNewLine( 1)
Call rtitem.AppendText("More of the message include's parent original
subject." & getSubject &". ")
Call rtitem.AddNewLine( 2 )
Call rtitem.AppendText(" To view this document click here---->")
Set doc = Source.document
Call rtitem.AppendDocLink( doc, db.Title ) 'Append a doclink
newDoc.Subject = "Subject you want"
Call newDoc.Send( False, doc.notifylist) 'Sends it to the Persons
included in the notify list
Repeat this for the Response to Response Form.