Technical Brief

FileMaker Go 1.2.1 Technical Brief
25
Using Location Information
While FileMaker Go cannot access any GPS features of the iPhone, with a little creativity and a web viewer, it is
possible to work around this limitation. The technique involves a combination of a simple HTML5 page and some
JavaScript.SinceSafariontheiPhonesupportsHTML5geolocationservices,socanFileMakerGobecauseaweb
viewer object uses the Safari engine to handle rendering of web pages.
Imagineasalesteamthatcould“stamp”theircustomerlocationswhiledoingdataentryalongatravelroute—all
within FileMaker. Likewise, it would also be possible for a user to record mileage (at least as the crow flies). There
are numerous possibilities.
Chad Novotny (The Support Group) and Todd Geist (Geist Interactive) have each posted blog entries that show
how to accomplish this. A Google search for FileMaker Go geolocation will quickly provide links to both articles.
Scripts That Run On Open and Close of a FileMaker Database
Scripts set to run when a database opens and closes behave the same way as they do in FileMaker Pro. However,
user behavior and FileMaker Go hibernation require extra consideration of these scripts. As with FileMaker Pro,
anopeningscriptwillrunwhenale’srstwindowisdisplayed.ThisistrueforFileMakerGo.However,ifauser
returnstoFileMakerGoafterclosingtheapplicationandrespondingwitha“yes”tothedialogaskingifhewants
to resume working with his prior open databases, FileMaker Go will do exactly that—return the user to his prior
state and not perform any script specified in the File Options.
Likewise, scripts set to run when the file closes only run when a user (or a script) closes the final open window for a
given file. If a user hits the Home button or is interrupted by a phone call, FileMaker Go will close without running
any additional scripts including the one set to run when a file closes.
Related Record Locking Transactions
While not exactly a scripting strategy, a consideration is the potential for related records to get out of sync in
dependent edits. If, for example, you needed to ensure that either all changes to a related set of records are
committed or none are, one approach is to use the natural behavior of the locking mechanism in FileMaker Pro.
If you open a record, any changes made to related records through portals while that record is uncommitted are
also uncommitted.
Todd Geist, a regular contributor to the FileMaker developer community, has spoken and written about a
transactional model that takes advantage of this fact if you need to ensure an atomic operation on a complex
process. All changes to a parent record, and to its children made through portals on the uncommitted parent,
will either commit or completely roll back if the operation gets interrupted. This technique has been around for
years and is well understood by advanced developers. It is of renewed interest given the much less persistent
connection to the host from mobile devices.
Todd has posted some information at http://www.geistinteractive.com and http://www.geistinteractive.com/
content/inventory-transactions.