I have a db with replicas on 4 different servers. The main form has a field called “office”; and there is an “admin” view which has the necessary docs that do a db look up. I want to filter replication by two things - the field ‘office’ and the ‘admin’ view. I set the selective rep formula as SELECT Office = “officename”; that works really well to filter the offices, but because it is not pulling any of the docs in the admin view; I keep getting a ‘invalid or non-existent doc’. How do I include a view in a selective replication formula?i.e. I want to set the selective rep formula to filter by field and one particular view.
Thanks in advance. Don’t know what I would do without this forum.
Helen
Subject: Selective replication formula – help please
I think you’ll find most people recommend you use Readers fields for “selective replication” as being more secure and reliable, but I’ve found good uses for selective replication; first off it’s quicker to implement.
When you choose to replicate based on a formula, the formula acts on individual documents and the values they contain. The only way you’re going to be able to include the contents of the “amdin” view, is to include it’s view selection in your selection formula, or create a field in each of the documents in that view that the replication formula can act on. For example, a field called “alwaysReplicate” that is equal to “Yes”, and you can include that in the formula.
Optionally, in the advanced replication settings you could select to replicate by Views or Folders instead, and you could select your admin view, and then create a view or folder that will contain the other office documents that you want to replicate and select that as well.
Subject: Selective replication formula – help please
Add the view selection criteria to your replication formula.
Or select replicate a View.
Subject: RE: Selective replication formula – help please
Bruce,Thanks for you quick response. Since I am not good at formula language or script; I was actually looking for the syntax. Sorry I didn’t mention it in my earlier post.
Would this work?
SELECT Office = “officename” | view = “admin”
Thanks again.
Helen
Subject: Selective replication formula – help please
Option #1: append the selection from admin view to your replication formula using “|” (OR) operator:SELECT Office = “officename” | .
Option #2: it is possible to use replication option that enables you to decide what views are received when the specified replica replicates with another specified one. It can be done manually or programmatically.
To change the option manually use Replication settings → Advanced → Receive only a subset information from other replica, select the source and the destination replica and the views should be involved in to the replication. In this case documents that do not belong to the selected views will not received from the other replica. So you should create a view that will contain both documents from admin view and Office = “officename” documents (the selection formula is identical to that from option #1).
Hope this helps.