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).
Overview
The "Zync It" scripts were imported into your file as part of integrating GoZync. These are the scripts which start many syncs and are called buy some of then "sync' and "upload" buttons in our example files.
You can also call the API scripts in GoZyncMobile directly, as you would if you wanted to start a sync out of context (from another table occurrence) or wanted more control.
How do I call the Zync It scripts and which options do they support?
Zync It - This Table. Call this script if you're on a table your want to Zync; you'll call this script with no script parameters and it will run then default
Zync options for that table/layout. You must be on a layout base on a
primary TO? (table occurrence) and whose TO is configured in GoZync: is one of the TOs listed in GoZyncHosted's dashboard.
Zync It - This Record ( RecordID ). This is just like the script above (it performs the default
zync options for the table occurrence you're on) but it only does so for one record. You'll pass in the record's
primary key as a script parameter. In the example below "_id" is the primary key of the table, "TimeRecords":
Zync It - This File. Call this script without any script parameters and it will run the default
zync options for every zynced TO in the file. This is certainly the simplest way to Zync, but if your app has many
primary TOs you many not want to sync them all every time.
Call in the API scripts in GoZyncMobile directly
If you want more control over your syncs, you can call the syncing API scripts in GoZyncMobile.fmp12 directly from your file. The script you're interested in is located in the "Zync It" folder and is called:
Zync It - Public API - ( TOName ) { Action ; RecordID }
Notes at the top of the script explain the parameters it accepts, but here are some more details:
TOName - This is the name of the table occurrence you want to sync. The most common reason for calling this API script directly is when you're users aren't "on" the TO they want to Zync: they're on an interface records or a child record. Pass the TO name like this: "TOName = Projects" Note the spaces on either side of the equals sign: those are required. "TOName= Projects" won't work.
TOName is the only required script parameter.
The TOName parameter can also accept lists of TOs separated by carriage returns. Like this: "TOName = Projects¶Staff¶WorkTypes"
Action - Optionally you can specify the action you'd like take on a TO. Possible actions are Push, Pull, and Round Trip. Including an action would look like this: "TOName = Projects ; Action = Pull". Note the spaces on either side of the semicolon: those are required.
The Action parameter is required if you pass in a list of TONames
RecordID - Allows you to sync just one record: pass in the
primary key of the record you're interested in. Like this: "TOName = Projects ; RecordID = " & TimeRecords::_id
You can't pass in a RecordID when you've passed in a list of TONames.