?
Solved

Is there an @command to enable replication for a selected database

Posted on 2009-02-16
5
Medium Priority
?
519 Views
Last Modified: 2013-12-18
Here is button formula to add a database to user's workspace, open, then initiate replication.  I need to be able to set replication "on" or "enable" replication for the LOCAL REPLICA after it's replicated for future replications, or place a checkmark beside the local replicated db.  Can this be done in formula ?
@Command([AddDatabase]; "servername" : "c_dir/Rpt.nsf" ) ;
@Command([FileOpenDatabase]; "servername" : "c_dir/Rpt.nsf") ;
@Prompt([Ok];"Local Replica of Reports Database" ; "Press OK to continue. You will then be prompted to locally replicate this application. You can respond by clicking OK or Cancel.") ;
@Command([FileNewReplica]) ;
@Command( [Replicator] )

Open in new window

0
Comment
Question by:KTTKTT
  • 3
  • 2
5 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 23654640
I suppose that's not necessary, the database should be picked up automatically. I hope. But apparently it isn't, since you're asking the question.

See the Designe Help database, open the Index, and look under @Commands  for commands starting with Replic

There is, in LotusScript, a Replicate method in a NotesDatabase object. You could put that in an agent, and activate the agent from Formula. Would that be a solution??
0
 

Author Comment

by:KTTKTT
ID: 23659960
Yes, the db. is picked up automatically and it successfully replicates, but also need it to enable replica for future replication.  There are no @commands that will do it from my research and trial and error.  I did see in help.   Is there a way I can combine both formula and the following script I found in Help to enable the current local replica.  The button will be distributing via email, so an agent may not be feasible for this case.
This script enables replication in databases where replication has been disabled.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim rep As NotesReplication
Set db = session.CurrentDatabase
Set rep = db.ReplicationInfo
If rep.Disabled Then
  rep.Disabled = False
End If
Call rep.Save()
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 23660938
Make two buttons? Formula and Script cannot be combined in one event.

Send them a link of the database, and put some code in the PostOpen event of the database??
0
 

Author Comment

by:KTTKTT
ID: 23662367
The button formula code below opens server copy - adds connection:
@Command([AddDatabase]; "servername" : "c_dir/Rpt.nsf" ) ;
@Command([FileOpenDatabase]; "servername" : "c_dir/Rpt.nsf") ;
@Prompt([Ok];"Local Replica of Reports Database" ; "Press OK to continue. You will then be prompted to locally replicate this application. You can respond by clicking OK or Cancel.") ;
@Command([FileNewReplica]) ;
@Command( [Replicator] )
------------------------------------------------------
I'll keep this button "as is" .  I added this script at your suggestion to the PostOpen event of the Database Script to enable replication after opening:
'This script enables replication in databases where replication has been disabled.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim rep As NotesReplication
Set db = session.CurrentDatabase
Set rep = db.ReplicationInfo
If rep.Disabled Then
  rep.Disabled = False
End If
Call rep.Save()
---------------------------
My original question was actually referring to the replicator page - was wondering if there was a way to programmatically place a check mark under "Enabled" for the current db., but I may have to leave that to the user to determine if they want this option checked for replication.   I guess the only significance here is that when you click "Start Now", all checked items replicate; otherwise, the user can still manually initiate replication.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 23662500
There must be a way to do what you want automatically, but I'm not familiar with it. Sorry...

If you can live with the current method, I think that would be great, for pursuing this matter to the end could cost a lot of time.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses
Course of the Month16 days, 19 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question