Downloading Found Sets
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).
Can someone in the field download just their data?
Yes. GoZync lets you build a found set of records to bring down to your mobile device. These could be the records for a given user ("my contacts") or the records for that user which are flagged to be done that day ("my appointments for today"). You get to build the found set using whatever scripts you'd like – you're in FileMaker, after all – and GoZync will package up the resulting found set for the mobile user.
Here is how it works.
There is a single script in GoZyncHosted that controls bringing data down to a mobile device. The script is "Filter Records To Zync" and it begins by performing a "Show All Records" command.
If you leave it like this, all records will be considered for sync. Of those, only those that have changed since the user's last sync will be brought down.
But, you can modify this script to build found sets depending on the table being synced. Each table you want to do this for would get its own branch (its own "IF" section). Here is what one such branch might look like:
We're on a layout based on the table occurrence "WorkTypes", performing a find that only grabs the active work types. Using simple FileMaker Finds like this, you can easily add sophisticated syncing behaviors to GoZync.
Tips for building found sets.
Tagging Found Sets.
You may want to mark records as having been downloaded, and in some cases record who downloaded them. This can be used as part of marking a record "checked out" and/or preventing such tagged records from being edited on the server while the mobile user has them.
To tag a record when it is being pulled down to a mobile device, edit the script "Edit Record being Pulled..." and you'll see branches very similar to those discussed above in building found sets. For each table occurrence, create SetField steps that mark the records as you see fit.
Don't forget that you'll probably want to un-tag these records when they are synced back from the mobile device. You can do that by editing the script "Before Committing Entity".
Passing filter criteria up from the mobile file
This feature was adding in version 3.17 of GoZync.
As described above, the script "Filter Records To Zync" in GoZyncHosted determines the found set which should be synced for each table. It is within this found set that we look for records changed since the last sync.
In some cases, you may want your users to determine which records sync. For example, they may ask for records from a certain territory (selecting a different territory every time) or you may simply need to include some fact about the mobile file (maybe the user's ID) in the find requests you're building in "Filter Records To Zync".
To do that, GoZyncMobile has a method for passing name-value pairs up to GoZyncHosted so they can be included in your find requests. Here's how to take advantage of this:
Can I "push" just a found set of records up from my mobile device?
Yes. Checkout Pushing Found Sets.