Turning Off Deletes

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).


GoZync will pass deletes down to the local file, deleting records from your iPhone / iPad that are no longer in the hosted file. These records are also deleted when records on the host no longer "belong to you" (i.e. no longer match your found set criteria).

For more background on this, read up on deletes.

Normally, this is exactly how you want things to work. But, in very large tables the overhead of managing deletes can slow things when you pull records down to your local file. GoZync will build a list of all the record IDs that should be on your iPad every time you pull: it does this if records were changed or not.

So, if your workflow is more static for some tables--you're not always pulling just "today's" orders, etc.--you may want to turn this behavior off and delete records from the iPad on your own.

This is an easy mod, and this article shows you how to do it.


Here are some examples of when you may want to turn this off. And remember, you can turn this off file-wide, or just for individual tables.

Example: My Appointments for Today
You're pulling just the appointments each of your service techs have each morning. GoZync's auto delete feature should be left on for the appointments table, since you want GoZync to delete those appointments no longer assigned to this technician and those that have been rescheduled for another day.
But you may want to turn deletes off for the 10k record price list table you're also pulling. Items on the price list aren't deleted on the server that often, and you can set a deleted flag there instead and then have a script in the iPad app the finds any records flagged for deletion and deletes them. Much faster that doing deletes as part of the sync.
Example: Pricing History for Customers
You're pulling the 3 month pricing history for each customer. There are tens of thousands of records and you only want to keep records from the last 3 months on the iPad.
Turning GoZync's deletes off will really speed up this pull because you can simply have a script on the iPad that finds records older than 3 months and deletes them. Better yet, since there is no penalty for finding no records when searching on an indexed field, you can run this iPad's delete script every day.

How to turn GoZync's deletes off

All the changes you need to make are in the script "Get IDs for Found Set..." in GoZyncHosted.

If you want to turn off deletes for the whole solution (every table you're syncing) then simply add an Exit Script () step as shown in the blue line below and you're done. (click on the image below for a larger screen shot)

If instead you'd like to turn this off per-table, you need to make two changes. The first involves adding the Exit Loop If () line shown in blue below. Test for the variable $TO equaling the Table Occurrence name you'd like to turn this off for. This is the name of the TO you created in GoZyncHosted to represent the TO in your hosted fie.

Then add the lines shown below, testing for the names of any related table occurrences for which you'd like to turn off deletes:

That's it.

If you don't see a speed increase, double check that you have spelled the TOs name(s) correctly, or take a look at the last zynced package in then Zync Logs tab of GoZyncMobile (after a successful sync) to see if any of the IDs from the table(s) you're trying to turn off are in the package, between the <ids></ids> tags.

[email protected]
Follow us: