5 Replies Latest reply on Oct 5, 2012 5:09 AM by marcus.holmes@mac.com

    Open and save file in container



      Open and save file in container



           We store Word docs in FM12 container fields. I want users to be able to open the files in Word, edit and save them as required, and for the users always to access the latest version of the file.

           But when the files are opened (by using Export Field Contents), a copy of the file is opened, not the original file, so any changes in Word are not saved as they are overwritten by the original FileMaker version the next time the file gets exported from FileMaker.

           I've tried storing the files as file references, but the same problem - it's not the original file that gets opened but a copy each time.

           I can't see why there's not a simple "Open" command for a container (as well as Export Field Contents) that just opens the original file. Or is there another way around this?


           Any ideas? Thanks in advance!


        • 1. Re: Open and save file in container

               In a shared database, you must "lock" a record or in your example Word Document, to prevent multi-changes on the same Doc at same time.

               Brainstorming... [one cup of coffee is a slight drizzle]

               1) Make a TO with each Document identified and linked to a previous edited [and locked] version and Timestamped on last update.

               2) Make a new linked Doc Record with a copy of last edited Doc to start a new non-locked version to be used one user.

               3) Mark that file as "out of file by [user name] cannot be edited at this time" message.

               4) Clear that file when the user returns the edited file.  Then lock it and prevent the change.  go back to step #2.  Rinse and repeat.


               This is a classic shared file [only one Master Copy] technique.

               Problem is everyone wants control of the Master Copy,sad


          • 2. Re: Open and save file in container

                 Supplementing Jim's post...

                 To open the file and save it back to the container field, if you use "store a reference" and "Insert File" when inserting the file, you can open the original copy if you double click the container field. In a script, go to field with the "select contents" option specified will open the file as well.

                 If you can't get the file to open for you with a double click--some options in FileMaker 12 can prevent it, You can use Export Field contents, but add a 'save' script that re-inserts the file from the exported location back into the container field. The user would typically need to click button to "save" the file after they have finished editing the file and closed it.

            • 3. Re: Open and save file in container


                   Very nice and easy way for the User of the Master Copy to do an update.

                   Your "Save" button could also do the "house keeping"  of Locking and Making a new file to be ready for another Edit.


                   Locked means really LOCKED!  You can't allow read or write or the user will go back to a real old version and bypass other updates.

                   This classically referred to as the "Red Line Version" or "out for updates"

                   Good Luck!wink


              • 4. Re: Open and save file in container

                     Two cents:

                     I think 90% of your problem will be the administrative management of issues, latest, who gets to edit now, what happens to conflicting edits, etc; nothing to do with the FM aspect of the problem.

                     If you want to do exactly as you asked, namely: click to open the Word document, edit it, save, and when the next user clicks to open they see the updated version, etc  that is easy.  Simply make a button that uses Open URL and set that to be the filepath to the Word document.  It will open, allow edit, save, and when you click the 'Open' button next time it will be the new version.

                     You could include the 'Record Locking' feature by setting the 'Booked out to' field, and checking for that before you let the next user open it.

                     The users will have to get into the practice of 'Unbooking' the documents they have currently 'booked ou', but it is an easy housekeeping task to verify which docs are currently booked, and by whom.

                     This simplicity of course means that there is no version tracking.  That could be good or bad.  Of course all the suggestions depend upon good admin practices by the users.

                • 5. Re: Open and save file in container

                       Thanks all for your thoughts - very helpful.

                       sorsbuster wrote:

                  Simply make a button that uses Open URL and set that to be the filepath to the Word document

                       That's what I was after - didn't realise that step could open a file, I assumed it was just for opening web addresses - useful for having that misconception overturned.

                       We have actually been using Troi File for the doc management in FM11, which seems very flexible and gives you a lot of options for file and folder manipulation - worth looking at for anyone interested.

                       Thanks again!