FM Go Deployment Strategy and Open URL Fail
We have a GO solution that runs on the separation model. The interface file is local to the device with the data streaming down from a hosted related file.
Using a technique that we read about in Filemaker 12 Developer Reference (Bowers and his crew always produce amazingly useful stuff) we are attempting to have upgraded interface files pushed out to the iOS devices automatically as needed. We modified the technique a little and maybe that's what's causing the problem...
Essentially, in the hosted file we have a container field that holds the latest interface file. There is also a field that contains the latest version number in the data file. When an interface file on an iOS device launches the OnOpen script compares the local version number with latest version number in the data file. If the iOS version is behind, it calls a script in the data file which is supposed to in turn call a subscript in the local interface file that will close the interface file and then export the field contents of the file field from the data file to the iOS device, writing over the outdated local file, and opening the newly exported updated file.
For some reason we can't get the local interface file to close, so it won't allow itself to be written over. I was hoping someone might have some suggestions. I can't get the Open URL step to trigger the script that closes the file. Maybe the URL is wrong. Maybe there is a better way to do this.
The OnOpen script on the iOS local file:
Go To Layout ["zResources" (zResources)]
If[zResources::VersionNumber < zResourcesHostFile::LatestiPhoneVersionNumber)
Show Custom Dialog ["Update Version" ; "Your local version of the interface is out of date."]
If(Get(LastMessageChoice) = 1
Perform Script ["Update iPhone Version" from file; HostFile
The Update iPhone Version in the HostFile:
Open URL [No dialog; "fmp://Interface.fmp12?Script=CloseFile"]
Set Variable [$Filename; Value: "file:Interface.fmp12"]
Export Field Contents [zResoucesHostFile::iPhoneFile ; $Filename"]
Open URL [No Dialog; "fmp://~/Interface.fmp12"]
The issue seems really to be getting the local interface file to close. It won't allow an overwrite of an open file. I'd welcome any thoughts on what might be amiss here.
Thanks in advance.