Domino Code Fragment

Code Name*
Make the loser the winner
Date*
02/13/1999
Source (or email address if you prefer)*
Kcpauli@usa.net
IP address:.3.128.30.77
Description*
Agent to promote the loser of a replication conflict to be the winner
Type*
LotusScript
Categories*
Diagnostics/Analysis/Debugging
Implementation:
None (plug and play)
Required Client:
Server:
Limitations:
Comments:
Put this code into an agent that runs on selected documents. After running, you can then delete the original "winner" document.
Files/Graphics attachments (if applicable): Code:
Sub Initialize
 ' From Kevin Pauli (kcpauli@usa.net)
 Dim session As New NotesSession
 Set db = session.CurrentDatabase
 Set collection = db.UnprocessedDocuments
 Set doc = collection.GetFirstDocument
 Call doc.RemoveItem( "$Conflict" )
 If doc.IsResponse Then
   Set parent = db.GetDocumentByUNID( doc.ParentDocumentUNID )
   If parent.IsResponse Then
     Dim grandParent As NotesDocument
     Set grandParent = db.GetDocumentByUNID(parent.ParentDocumentUNID )
     Call doc.MakeResponse( grandParent )
   Else
     Call doc.RemoveItem( "$REF" )
   End If
 End If
 Call doc.Save( True, True )
End Sub