Integration 3 Of 4

These are the notes for GoZync 3. Docs for the latest version of GoZync--GoZync 4--can be found here. GoZync 4 is a free upgrade and is highly recommended (hint: it's faster).

Background: Pasting in Fields and Scripts

GoZync just needs a couple of fields in your tables. Please add these fields exactly as they are in our sample files and don't change their names.

You'll also paste in a folder of scripts. Like the fields, most of these come in without requiring any modification. There is one script you'll want to change: more on that below.

Step 6.1: Adding a new table to your mobile file

Pasting in the gz table.

Open one of GoZync sample mobile files (like QuickContact) and copy the gz table, pasting it into your mobile file. The table requires no modification and no records. You do not need to do this in your hosted file.
If you don't have FileMaker Advanced, and can't copy and paste tables, you can import the gz table into your file; starting in your mobile file, click "import" in the lower right of the Tables tab of File / Manage / Database.

Step 6.2: Add required fields

You'll need to add a couple fields to your tables to get GoZync to work.

The fields are listed below. If you have FileMaker Advanced you can simply copy and paste these fields from one of GoZync's example files (be sure to copy the hosted fields from the hosted example file, the mobile ones from mobile).
If you don't have Advanced, just recreate the fields in your table, paying special attention to the field's type and auto-enter definition (if any). Or get in touch and we can wire this up for you.
And while you need these fields in your tables, you DON'T want them on your sync layouts.
The hosted tables only require a single new field named "gz_ModTimeStamp". Copy this field from QuickContactHosted.fmp12.
Your mobile tables require four GoZync fields:
Copy these from QuickContact.fmp12 (our mobile example file). None of these fields will require any modification after being pasted in.
NOTE: A table in your mobile file that will only be synced as related records *technically* only needs the "gz_ModTimeStamp" field. But for simplicity and flexibility, we advise that you add all four fields into every table in your mobile file that you want to sync.

Modification of related records.

If your sync layout has related fields or portals on it, take a moment to read about how GoZync considers a record "changed" as you may need to add some some scripts so changes to related records still trigger a record to sync.

A note about field names.

The following characters are prohibited in field names when syncing: #, !, , ., / Please remove them from any field names in your synced tables. Also make sure no field names contain the word "and".

Step 6.3: Required Scripts (Mobile file only)

Pasting in scripts.

Again, open one of GoZync sample mobile files (like QuickContact.fmp12) and in scripts you'll see a folder called "GoZync".

- Be sure that the example file you're copying from is in the same folder as your mobile file and GoZyncMobile.fmp12

Then copy that folder and paste it into your mobile file. (You don't need to add these to your hosted file.) If you don't have FileMaker Advanced you can import the folder of scripts by clicking the "import" icon in the lower right of the Manage Scripts window in your mobile file.
You only need to edit one of these scripts, "Zync - Is a new version permitted". Toward the beginning of that script we go to a layout based on the primary TO you're syncing. Edit the script so you're going to the right layout. You can return to this script later to add additional branches for other TOs you may be syncing in the same file.

Step 7: UUIDs

Convert your primary keys to UUIDs.

Each table you're going to Zync, both on the mobile and hosted side needs its primary keys converted to UUIDs.
For more on the rationale here and details on what UUIDs are, read our article on UUIDs.
If you're already down with UUIDs, create your primary keys as Text fields with an auto-enter calc of Get(UUID). Uncheck "Do not replace existing value..." and check "Prohibit modification..."
Take your existing ID field and...
1. Turn it into a text field (you may have had it as a number originally).
2. Add an auto-enter calc. Click "Options" and then "Specify" next to "Calculated value". Enter the following as the calc definition:
Get ( UUID )
Your calc should look like this:
3. Set it to not be modifiable. Click "OK" on the screen above and make sure your auto-enter options are set like this:
Be sure to do this in both your mobile and hosted files. And if you're creating these fields just for sync, be sure they're indexed (in field options, click storage and either check "Automatically create indexes...")

Checking Your Work

Scan and Validate

Click "Refresh..." at the bottom of the screen to check your work..

Visit the "Fields & Scripts" tab of the Integration wizard in GZH. When everything checks out green you can move on to The Relationships Tab: Step 4 of 4.
[email protected]
Follow us: