After a handle has been established on a NSF is it possible to use LS to determine if there are any selective replication settings in the database?
The NotesReplication class’s GetEntry() requires source variables etc to be listed. Ideally I guess I need a GetAllEntries() method (and a .count would be handy too).
Any thoughts?
Subject: Checking for Selective Replication Formula
You can use the NotesNoteCollection class to accomplish what you’re trying to do. The function below populates the parameter array of server names it is passed. You can loop through the resulting array to access each server’s NotesReplicationEntry and check/change the formula, etc.
hth,
dgg
Function getSourceServers(pndbTarget As NotesDatabase, pstrServersOut() As String) As Boolean
On Error Goto errorHandler
Dim ntclxn As NotesNoteCollection
Dim docDznNote As NotesDocument
Dim i As Integer
Dim strNoteID As String
Dim varTmp As Variant
getSourceServers = False
Set ntclxn = pndbTarget.CreateNoteCollection(False)
ntclxn.SelectReplicationFormulas = True
Call ntclxn.BuildCollection()
varTmp = Split("-", ",") '// get a default array value
strNoteID$ = ntClxn.GetFirstNoteId()
For i = 1 To ntclxn.Count
Set docDznNote = pndbTarget.GetDocumentByID(strNoteID$)
If Not(docDznNote Is Nothing) Then
varTmp = Arrayappend(varTmp, docDznNote.GetItemValue("$ReplSrcServers"))
End If
strNoteID$ = ntClxn.GetNextNoteId(strNoteID$)
Next i
varTmp = Arrayunique(varTmp, 5)
Redim pstrServersOut(0 To Ubound(varTmp)) As String
For i = 0 To Ubound(varTmp)
pstrServersOut(i) = varTmp(i)
Next i
getSourceServers = True
thisExit:
Exit Function
errorHandler:
Msgbox "Error " & Err & ": " & Error$ & " encountered at line " & Erl & " of " & Getthreadinfo(1) & ".", , "Error encountered . . ."
Print "Error " & Err & ": " & Error$ & " encountered at line " & Erl & " of " & Getthreadinfo(1) & " . . ."
Resume thisExit
End Function