From SeedCode Documentation

GoZync5: SetupGTRR

Overview

The Go To Related Record script step is one of the fastest ways to move between found sets in a FileMaker solution. Unfortunately it is also one of the steps where you can't substitute data for literal FileMaker layouts and table occurrences: you can't "abstract" it.

So in order to use this script step in GoZync you need to add a couple of lines to the existing "Setup Go To Related Records (TOName)" script for each table occurrence you'd like to sync. There is one such script in GoZyncMobile, and you imported one into your hosted file (your equivalent of WorxHosted).

In GoZyncMobile: Editing the script

Open GoZyncMobile and edit the script "Setup Go To Related Records (TOName)". You'll see two ElseIF branches for our sample entity "Contacts": one in the "hosted" section, and one in "mobile". Notice how in both cases, the name of the $TOName we're looking for ("gzh_Contact" for example) matches the name of the "from table" in the Go to Related Record step.

You'll want to continue this pattern and add a branch (an ElseIf / Go To Related Record pair) for each of the hosted and mobile tables you're syncing. Do this for both parent and child tables.

Note that the layout you use in every case is "$TOName" and that all the TOs referenced in the "Hosted" section should begin "gzh_" and those in the "Mobile" section should begin "gzm_".

Check your work (important)

After you've edited this script, please check your work by running the script right below it in GoZyncMobile: " --> Then Run This...Test "Setup Go To Related Records (TOName)" Script".

This will make sure that you have a valid branch for each of the table occurrences you've wired into the graph in GoZyncMobile. This script is also run when you click "refresh & check for errors" button on the Configuration tab of GoZyncHosted.

In Your Hosted File: Editing the script

There is an almost identical script you'll import into your hosted file, though this one only has branches for the hosted size (the gzh_ side).

The script is called "Setup Go To Related Records (TOName)" and is set up just like the one in Mobile. The big difference (aside from not having gzm branches) is that you'll want to select "match all records" in this version, where in GoZyncMobile we only matched the current record.

Check your work (important)

When you're done wiring this up in your hosted file you'll need to edit one script in GoZyncHosted before you can check your work. In GoZyncHosted, edit the script "Call Test GTRR in their Hosted File". You'll have to log in as an administrator first--instructions are on the License Admin tab--and then run the "Manage Scripts" script under "Manage Scripts". Recursive, I know.

Once you've opened the script "Call Test GTRR in their Hosted File", the first perform script line will likely be broken unless you're still syncing with WorxHosted. Make sure the first "Perform Script" line calls the script "TEST Go To Related Records (Parent and Child To Test)" in YOUR hosted file with a script parameter of Get ( ScriptParameter).

Here's a PDF of the script "Call Test GTRR in their Hosted File" for your reference in case your copy looks weird or has blank lines: Call Test GTRR

Once you've edited that script, click "refresh & check for errors" button on the Configuration tab of GoZyncHosted. Note that you'll need all synced files open (both hosted and mobile) to run these tests.

Once that passes you can return to step 3.6 of the integration.

Retrieved from http://www.seedcode.com/pmwiki/index.php?n=GoZync5.SetupGTRR
Page last modified on February 26, 2016, at 02:33 PM