Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Upgrade GO File and Open URL to Trigger Script

Featured Replies

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

End If

 

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.

 

 

 

How can it close the file when the script is still running?

  • 1 year later...

Struggling with the same issue. FMGo13 with hosted FM12 Client Downloader.

 

I split the process in two, thinking that the calling iOS file's script (which lists in the stack) is keeping the local file open. So, I open the Client Downloader and land on an Update layout. No script is running at this point. All works fine on iMac, but on FMGo, the local UI file refuses to close (Error 13 - File or object is in use).

 

I removed the Client Updater's EDS to the local UI file and tried OpenURL, but that too, fails.

 

Going in circles...

 

EDIT: resorted to a local file that handles the export of containers and closing the local files. sigh.

And I'm back...still cannot get the local iPad file to close. Reading absolutely every post on this topic. Ya know it's one stupid script step I'm overlooking!

Use Close Window [interface] to close the interface file. Close File does not work consistently on an iPad.

Thanks for responding here and on TechNet. I'll be at this again tomorrow, and will try Close Window.

 

Right now I have three local files and a hosted file with the new binaries. The 3 local are : UI, Data, and Sync. UI has EDS to Data and Sync has EDS to Host UI and Host Data, local UI and Data.

 

I'd like to not use a local updater, but rather have the local UI call the hosted Client Downloader. However, it seems that since the local UI calls the hosted Client Downloader, that script is in the call stack and prevents the hosted Client Downloader from closing the local UI (Data).

 

What files and EDS should I have, at minimum?

You need two script on the hosted file. The first one is a script that puts the hosted file on a blank layout with one button labeled with something like Continue with Update. The UI file will call this script. The button executes the following Script

Close Window (Interface)

Export field contents

Open (Interface)

This is a little simplified but it should get you where you need to be.

I'm trying to avoid two buttons for Update. I want them to click one button, OK a Custom Dialog to proceed and off we go. Sounds like you're saying that I need an Update button in the local UI, and a Continue in the hosted file?

 

 

I need to use FMP Protocol to close the interface file, correct, bcs the hosted file cannot have an EDS to the local UI.

Well, saga continues. I have tried to have the local UI call the hosted file's script which closes the local UI and then exports. I didn't want to stop at the hosted file and have the user click Continue Update and so I tried the InstallOnTimer trick as outlined here by Colibri. Doesn't work for me (Colibri was in .fp7).

 

Now I'll give up and stop the user at the hosted file and have him click "Continue Update." Let's see if that helps.

omg - so now I get an Error 13, but it does actually close and overwrite the local UI.

Well, victory! Had to use two button update, though, and File Close worked for me, but Close Window didn't.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.