Salve Fabio !
One option is to use a FileMaker file as a host for your new file in a container and then use the script Export Field Content.
That way you'll be able to control the naming and replace any existing file.
Just be sure the file you want to replace is not already opened.
Hi Tom, that's sound good!
So, i need another File used to update my main solution?
This is the script test:
1. AppName call Updater.
2. AppName is closed
3. Updater donwload in container from web the new AppName
4. Updater export container
5. Updater call AppName
6. Updater is closed
It's ok for you?
You can have the following.
Local AppName call Host.fmp12 (hosted)
Host closes Local AppName
Host export new Local AppName
Host opens new Local AppName
the fmp protocol and insert from URL is very handy in this.
I can't call Host (Hosted).
This is a stand alone app, and i prefer use "Insert from URL" function.
I don't want my App always connected on remote Host, because in many cases there isn't connection.
If i configure in External Data Source my Host, this is used only when the script is invoked, or FileMaker Go try to connect in every way on Host even if i don't use this "update script"?
You do not need to be connected at all from Local AppName
You just need to use the fmp protocol to open your Hosted file
The answer is: use fmp protocol!!!
Perfect, i have all elements for build this "updater".
I would be interested in knowing if this worked, and if it did, how did you handle the data that was in the original file?
I created an installer/updater file that handles updating and installing files for FM GO. The updater transfers data and the user doesn't have to do anything besides opening the updater file to update the file. When finished the updater deletes itself from the iPad or iPhone. You can see a demo of the file at http://www.psfe.com/fmfilemanageronthego/
You could update from the web if you wanted to, you just need to think outside the box. If you host an fmp file on a web server, then your ios solution could "insertfromurl" that fmp12 file into a container, then export field contents , then use the fmp protocol to open the exported file on your device and invoking a script. This may offer an advantage if the network infrastructure you are using has port 5003 blocked (some public wifi hotspots), just remember to allow .fmp12 as a mime type on your webserver.
I created an updater file that imports/updates all records from the original file. As of yet I do not know how to script the deletion of the updater file from the iPad. I have a message that comes up and tells the user to do it manually, but I would perfer it as a FM script step.
Hi Tom, i lost this post... i'm sorry!
Yes, my solution works very well, but i used a trick. The new upgraded app is empty (saving data not so important), so when i upgrade my app, i send via fmp:// protocol only an array with session data and the following script performs a request to server to download the actual data.
I used a PHP scripts and JSON format, that's parsed by FileMaker Go.
Before updating app, important data are transfer via InsertFromURL record by record via PHP script to Server (little data i.e. flags, fields and GPS information) this because i work always offline with FileMaker Go.
I can't get the hosted updater file to close the local iPad file. Since the local iPad file (which is the file that I need to replace) calls the hosted file, its script is listed in the call stack. I've tried OpenURL and InstallerOnTimer scripts, but they're not working for me. Could my issue also be that the local iPad file is a separated solution? Any advice appreciated. -Barbara
The problem is the local file can't completely finished the script before the delete occurs. To solve this create a layout on the hosted file that has a button attached to script that will delete the local file. The local file should call a script on the hosted file that goes to this layout. Also use Close Window to close the local file instead of Close File. Close Window is much more reliable to work.
Sent from my iPhone