Need to Centrally Manage replication formula for local replicas

Both client and server are 6.5.1

I have a Notes application that uses User Roles to determine what data to replicate to the local replicas.  Basically users can have one of five different replication formulas depending on their role.  I need to be able to have a user create a new local replica without having to manually paste in the formula that he or she needs.

I have been trying to use the new for R6 $Replication form and put a formula in the $HLFormula field of:

@If(@IsMember("[RoleA]";@UserRoles);AFormula;@IsMember("[RoleB]";@UserRoles);BFormula;@IsMember("[RoleC]";@UserRoles);CFormula;@IsMember("[RoleD]";@UserRoles);DFormula;OFormula)

Each individual formula is in its own hidden formula field on the $Replication form.

My problem is that the formula does not seem to be calculating based on the Role. Am I going down the wrong path and is there a better way to centrally manage replication formulas based on User Roles?
ccarlson62Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
HappyFunBallConnect With a Mentor Commented:
If you're using R6, you could build a button to create the replica for the end user.  Then use the NotesReplication class to dynamically create the replication formula based on the @UserRoles.  If you do this all within the button rather than within the replication formula, it should work fine.

The help entry for NotesReplicationEntry shows an example on how to use this new class.  

0
 
HappyFunBallCommented:
@UserRoles doesn't work locally unless the "Enforce Consistent ACL..." check box is set in the ACL of the database.
0
 
ccarlson62Author Commented:
"Enforce Consistent ACL..." is checked.  Thanks anyway.
0
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 
HappyFunBallCommented:
I don't know much more about the $Replication form but I don't think there's any better way (or even other way) to centrally manage replication unless via 3rd party software.  

If you just insert a basic replication formula without using @UserRoles, just for testing purposes, does it work ok?  Have you narrowed the problem down to the @UserRoles formula?  I wouldn't be surprised to learn that function doesn't work in that context.

Would it be possible to change your application to make use of reader fields in the documents?  You could use certain UserRoles in the list of Allowed Readers, and then replication would naturally only select documents each user had access to read.
0
 
Andrea ErcolinoCommented:
I don't know anything about this $Replication form, could you please tell me something?

Anyway, I found something in the Designer Help (6.5.1) that maybe useful for your problem. It says:
  ...
  Keep in mind the following points when you use replication formulas:
  - You cannot use @DbLookup, @UserName, @Environment, or @Now in a replication formula.
  ...

So I think that @UserRoles is not available in replication formulas, because it is very similar to @UserName...
0
 
Andrea ErcolinoCommented:
Readers fields are the best tool for this, though a little tricky.
If you go that way, remember to add always a role like Trusted in a Readers field, so that it's easy to get access to a protected document for someone trusted.

0
 
ccarlson62Author Commented:
I am already using Readers fields in this application.  Unfortunately, users of this app need to see a different set of data when they view the server vs. local.  This database is presently 32 Gig on the server so allowing users to replicate everything that they can see is not an option.

Note that I am not trying to use @UserRoles in the replication formula itself, only in the formula that calculates which of the five different replication formulas to use.

For those not familiar with $Replication form, there is not much I can point you to other than the fact that it is used in the R6Mail template and its use is discussed in the AD105 session of LotusSphere 2003. Available in the Sandbox.

Thanks for the suggestions, I will continue to try and get the $Replication form to work.
0
 
ccarlson62Author Commented:
Yes, I knew about the NotesReplicationEntry.  I was looking for something that was more dynamic so that if I changed a users role, his replication formula would update without the user having to do anything.  The other important peice that I failed to mention is that I would like the local to have the appropriate replication formula in it when it originally gets created via the policy doc.  If I can't get it to work, I will award HappyFunBall the points.

Thanks for the help!
0
All Courses

From novice to tech pro — start learning today.