Manage Learn to apply best practices and optimize your operations.

Notify Participant Within A Discussion Thread Of New Responses.

The following steps and script are used to create a notification list from
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
@If(@IsNewDoc;@Name([Abbreviate];@UserName);@Unique(@Explode(FieldName;","))) .

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
Author.

In the PostRecalc Event goes this formula
FIELD notifylist:=notifylist;
NewList:=notifylist:RespAuthor;
@SetField("Notifylist";@Unique(@Explode(NewList;",")))
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
notifylist.
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
unid
Set view = db.GetView("docbykey") 'Get view to find parent
Set parent = view.Getdocumentbykey(docid) 'Find parent by docid stored
in parid field
parent.replaceitemvalue"notifylist",(ModifyNotificationlist) 'Replace
existing notify 'list with new list
Call parent.save(False,True,True)

'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
End Sub

Repeat this for the Response to Response Form.

Dig Deeper on Domino Resources - Part 5

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close