Syncing related tables

Help, Tips, and Tricks for deploying GoZync: our "sync" engine for FileMaker Go.
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am
PostPosted: Tue Jan 28, 2014 1:27 pm
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
SeedCode Staff
SeedCode Staff
Posts: 475
Joined: Wed Jan 02, 2013 11:47 am
PostPosted: Tue Jan 28, 2014 2:43 pm
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
PostPosted: Tue Jan 28, 2014 5:18 pm
Great. Thanks for the info Jeff. I'll look into the link tomorrow.
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am
PostPosted: Tue Feb 04, 2014 8:31 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
SeedCode Staff
SeedCode Staff
Posts: 475
Joined: Wed Jan 02, 2013 11:47 am
PostPosted: Tue Feb 04, 2014 11:16 am
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
PostPosted: Tue Feb 04, 2014 12:04 pm
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!
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Tue Feb 04, 2014 12:09 pm
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

Return to GoZync

Who is online

Users browsing this forum: No registered users and 4 guests

cron
(855) SEEDCODE
[email protected]
Follow us: