GoZync3

Checking Out Records

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 I "check out" records so only the mobile own can edit them?

Absolutely. In fact, this is one of the most useful workflows GoZync enables. Note that checkout is not supported in the free version of GoZync.

What checkout looks like.

When users pull records down from your hosted solution, the record is marked as "checked out". You can simply set a field called "out" to 1, or record something more elaborate, like the name of the user who downloaded it, and when they did so.
(Remember, users can download just their own records, so it's not like it would be a surprise who downloaded the record, but seeing the name can give you an extra sense of reassurance, and can remind staffers – who may not know all the business rules – who owns which records.)
Then, access privileges in your solution prevent checked out records from being edited. This is great because users on the hosted solution (users "in the office") can edit records up until the moment a mobile user checks them out. Imagine: updating trouble ticket details up until the moment a mobile technician actually begins heading to the customer's location, but being prevented from changing it after that. Users would then know they need to call the mobile technician to communicate any new details about the ticket.
Once the ticket is resolved and the mobile user syncs their updated ticket back to the hosted solution, the ticket is "checked back in" and is now editable again.

How to implement it.

Getting this working in your solution is pretty simple. Reading up on downloading found sets will help give you come context for the changes that follow.

Checking out. Create a "checked out" field in your hosted solution. Feel free to add this to layouts, but don't add it to the layout used for Zyncing as there won't be a matching field on he mobile side. Edit the script "Edit Record being Pulled (TOName)" and create a branch (an If statement like the example there) which tests for the Table Occurrence name you're interested in. Then set the checked out field in that table.
Preventing edits of checked out records. In your hosted solution, use FileMaker's built in access privileges to prevent editing of records where "checked out" is not empty. In relational solutions you'll want to apply this restriction to child records as well: one should not be able to edit an invoice line item if the invoice is checked out, for example.
Checking in. Edit the script "After Committing Entity" and you'll see branches similar to those in "Edit Record..." above. Create a branch for your table occurrence and set the "checked out" field to blank (use two quotes without a space between them).

That's it.

(855) SEEDCODE
[email protected]
Follow us: