GoZync

Downloading Found Sets

How can I bring down just "my" records to the mobile device?

Overview

When a mobile device connects to GoZync to pull down data, it's a found set that's pulled down. And you can control that found set with FileMaker scripting (ie scripted find requests) bringing down "my" records, or "my, active" records, or "my, active records, due today."
While scripting a find for "active" records or "records due today" is pretty simple, some developers have trouble with the "my" part. Fortunately this is really easy.

Where is the found set created?

Each entity that you pull down to mobile has a "Package up..." script in GoZyncConnector as part of your integration,. In our example file, you'll find a script called "Package up Products". This script has two lines you can edit: the first controls which layout to use for "products" (for example). And the second line controls the found set.
By default, this second line says "Show All Records". Simply replace that line with a scripted find to bring down just some of the records.

So how do I find "my" records?

The same way you'd do it in the desktop version of FileMaker: using the logged in user. When your mobile users Zync, they'll authenticate (log in) to GoZyncConnector. This this script can use calcs like Get ( AccountName ) or Get ( AccountPrivilegeSetName ) to identify the logged in user and search for records tagged as belonging to them.
You challenge as a developer is simply to have some way to determine which records belong to a given account name. You can even do this as a Case statement in your find request. Say the records you're looking for are tagged with the users initials, your find request might search for the right initials based on the account name:
Case ( Get ( AccountName ) = "Joe Smith" ; "JS" ; Get ( AccountName ) = "Beth Samson" ; "BS".... etc.
That's it.
(855) SEEDCODE
[email protected]
Follow us: