I have several tables defined as dependent or related in the GoZync Hosted file. If I run a ZyncIt script for a single parent table, should GoZync automatically sync the parent and it's children or just the parent?
Thanks!
Jason
Syncing related tables
7 posts
• Page 1 of 1
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am |
|
Hi Jason. If you've set up related synching in GZH, then when you sync the parent table, all children will also be sycned, but only for parent records that have been modified. So if only child records are changed (or added, or deleted), you need to trigger the mod timestamp to update in the parent record so GoZync will sync it. We advise that you do this using an OnRecordCommit script trigger that just sets the gz_ModTimeStamp field in the parent record to "1" (which will force that field to auto-enter the current timestamp). More about all of that here:
http://www.seedcode.com/pmwiki/pmwiki.p ... RecordMods |
|
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am |
Great. Thanks for the info Jeff. I'll look into the link tomorrow.
|
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am |
Hi Jeff,
I was able to implement your suggestion and that is working well. I'm setting the parent to update whenever I change the children or grandchildren records. One additional issue has to do with the grandchildren records. When I do a Push for a particular record ID, it's only pushing the children tables: Visits -> Evaluations -> Eval Questions Eval Questions is set in the configuration to be a child of Evaluations but those records don't seem to get pushed when syncing the grandparent Visit. Is that expected? Thanks! Jason |
Hi Jason. Related syncing in GoZync only goes one "level" deep. It doesn't support synching of "grandchildren" (the engine would have to be exponentially more complex). You'll have to choose one of those relationships for related synching and sync the third table independently. Maybe set up Eval Questions as a child of Evaluations, and set up Visits to sync independently. HTH -Jeff
|
|
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am |
Thanks, Jeff. I set it up so that the Eval Questions table gets the Visits ID as well, and then set Eval Questions as a child of Visits in the config. That will work for now. Thanks for the reply!
|
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am |
Jason- that works. Just remember that the "parent" side of a relationship being synced needs to use the primary key of the table. GoZync won't consider relationships where the parent / left-hand side uses a foreign key.
HTH - John John Sindelar
SeedCode |
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests