Thursday, 15 November 2018

View Replication and Save Conflicts Including Differences Main Conflict Agent (1)


One of the daily tasks as Domino Administrator is solving the Replication and Save Conflict documents that arise almost daily in various databases. The first tool we use for managing the Replication and Save Conflict document is an Agent that is included in all Notes Databases and sends a mail to the Administrators group if in a database Replication and Save Conflicts have been created. In addition a View is included in all databases in which the Replication and Save Conflict documents are included. Finally we use an Agent and a Script Library which performs a comparison between the Replication and Save Conflict document and the Main Document in the database. In Below a description of the setup and how to easily implement it within existing Notes databases. In this blog post the Agent for monitoring the Replication and Save Conflicts in various databases and the View including the Replication and Save Conflict documents.

Agent MonitorConflicts
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.

Option Public

Sub Initialize
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.AddNewline(1)
Call rtitem.AddNewline(1)
Call rtitem.AppendText("This database has Replication and Save Conflict documents: ")
Call rtitem.AppendDocLink( db, db.Title )
Call maildoc.send(False)
End If

Exit Sub

ErrorHandler:
'exit routine
Exit Sub
End Sub

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.

No comments:

Post a Comment