Hello,
We’re thinking of a procedure to distribute a database that contains a few thousands of documents containing large attachments to about 150 laptops.
In an attempt to limit the number of documents in the local replica’s (as laptop-users usually consider themselves to be too busy to wait for a few MB to replicate), I’m experimenting with replication-formulas.
The goal is to have users decide what subset of documents they want to replicate, up to now I’ve come up with the following :
-
I create an empty replica, using ‘@False’ as replication-formula
-
In the Initialize-event of the database, I set the replication-formula. This is my (testing-)code :
Sub Initialize
Dim session As New NotesSession
Dim notesReplicInfo As NotesReplication
Dim notesReplic As NotesReplicationEntry
Set db = session.CurrentDatabase
If db.Server = "" Then
Set notesReplicInfo = db.ReplicationInfo
Set notesReplic = notesReplicInfo.GetEntry("-",session.UserName)
If Not notesReplic Is Nothing Then Call notesReplic.Remove
Set notesReplic = notesReplicInfo.GetEntry("-",session.UserName,True)
notesReplic.Formula = |(Field1 = "1") & (Field2 = "2")|
Call notesReplic.Save
Call notesReplicInfo.Save
End If
End Sub
- In the PostOpen-event of the database, I replicate the database :
Sub Postopen(Source As Notesuidatabase)
Call db.replicate("slndev02")
End Sub
The result of replicating ? An empty database …
When verifying the replication-settings, everything looks exactly the same as when setting the replication-formula manually, which causes the correct subset of documents to be replicated.
Can anyone shed some light on this mistery from the twilight-zone ?
Philippe