The Agent MonitorConflicts uses a View in which the Replication and Save Conflict documents are included. In the next blog post this View will be looked at and built up in a Notes database. Furthermore a Profile Form is used in the specific databases on which the registration is included to whom the final mail must be sent, the Domino Administrator group.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim pdoc As NotesDocument
Dim maildoc As NotesDocument
On Error Goto ErrorHandler
Set db = session.CurrentDatabase
Set view = db.GetView( "(MonitorConflicts)" )
Set pdoc = db.GetProfileDocument( "ProfileForm" )
If view.EntryCount <> 0 Then
Set maildoc = New NotesDocument( db )
maildoc.Form = "Memo"
maildoc.Principal = "Administrators"
maildoc.~$AltPrincipal = "Administrators"
maildoc.from = "Administrators"
maildoc.Subject = "Database " & db.Title & " has Replication and Conflict Documents"
maildoc.SendTo = pdoc.DominoAdministrators(0)
Set rtitem = New NotesRichTextItem( maildoc, "Body")
Call rtitem.AppendText("This database has Replication and Save Conflict documents: ")
Call rtitem.AppendDocLink( db, db.Title )
The Runtime for the Agent MonitorConflicts is On Schedule - Daily on Target All new & modified documents.
B. View MonitorConflicts
As mentioned above the Agent MonitorConflicts uses the View MonitorConflicts in which the Replication and Save Conflict documents are included. The View includes some reasonable information about the Replication and Save Conflict documents and not just the text 'Replication or Save Conflict'. First create a new View with no response hierarchy. Replication and Save Conflict documents are response documents. Next use the following Selection formula for the view: SELECT @IsAvailable($Conflict). In the View additional field information is displayed. For displaying additional field information the relative columns must be set as categorized or they will not appear. Use the following syntax for the Column Formula : @If(@IsAvailable($Conflict); @Text(FIELDNAME) + " - " + FIELNAME2;" "). For including the notation "[Replication or Save Conflict]" for each document (which makes it easier to select them) simply create a non-categorized column with the formula "". The View will look something like this in the end.
In the next blog post I will describe the Agents performing the comparison between the Replication and Save Conflict document and the Main Document in the database.