1 2 3 Previous Next 31 Replies Latest reply on Mar 25, 2016 1:24 PM by rgordon

    Remove / Delete a file on FileMaker Go 13

    StéphaneJaquemet

      Title

      Remove / Delete a file on FileMaker Go 13

      Post

           Hello, 
            
           I want to know if, instead of going on iTunes or the app FileMaker Go 13, there is a way to delete a file without having to do it manually, but by a script? 
            
           This exists with Filemaker Pro by export section that deletes the file, but how on Filemaker Go 13.
            
           Thanks

        • 1. Re: Remove / Delete a file on FileMaker Go 13
          AppGuy

               Here is the documentation on deleting on FM Go

                

          http://help.filemaker.com/app/answers/detail/a_id/11141/~/how-to-remove-files-from-filemaker-go

                

               You can overwrite a file with a newer version... i.e. upgrade it via a script...

               JP

          • 2. Re: Remove / Delete a file on FileMaker Go 13
            StéphaneJaquemet

                 Hi JP,

                  

                 This is not the response that I waited directly in the app Filemaker Go 13, the solution is :

                 Autor. annulation utilisateur [Non]

                 Gestion erreurs [Oui]

                 Définir variable [$chemin; Valeur : Obtenir ( CheminDocuments ) & "VOTRE_FICHIER.FMP12"]

                 Exporter enregistrements [Sans fenêtre; "$chemin"]

                 Fin de script []

                  

                 Thank your for your message

            • 3. Re: Remove / Delete a file on FileMaker Go 13
              AppGuy

                   Sorry Stephane - I can only read English...

              • 4. Re: Remove / Delete a file on FileMaker Go 13
                Markus Schneider

                     You can NOT delete a file using a script on FMGo, but You can export the data (and send the export file using mail, for example)

                • 5. Re: Remove / Delete a file on FileMaker Go 13
                  StéphaneJaquemet

                       Hi guys,

                       I will try to write in english and give the correct answer :

                       @markus

                       YES, we can delete a file in a script UNDER FMGo. This script under (english) is in an other file (of course) - example : delete.fmp12 to be calling the file and delete this file - example : file_to_delete.fmp12

                       @JP

                       example file where the script is in : delete.fmp12

                       Allow User Abort [Off]

                       Set Error Capture [On]

                       Set Variable [$path; Value: Get(DocumentsPath) & "file_to_delete.fmp12"]

                       Export Records [No dialog; "$path"]

                       Exit Script []

                        

                       I hope that my translation is correct and I can tell that is correct, the script used is functional in FMGo and delete the file.

                       Regards

                        

                  • 6. Re: Remove / Delete a file on FileMaker Go 13
                    philmodjunk

                         llow User Abort [Off]

                         Set Error Capture [On]

                         Set Variable [$path; Value: Get(DocumentsPath) & "file_to_delete.fmp12"]

                         Export Records [No dialog; "$path"]

                         Exit Script []

                         Last time that I tried that delete file method (in FileMaker 11), it did not delete the file, though it worked in FileMaker 10. (This was in windows). Looks like I need to test this one again in FMP 13... And it would not surprise me to learn that this doesn't work in FM GO.

                         You can, however, manually delete files directly from the iOS device if you pull up the FM GO list of "files on device" and "flick" a file name sideways. A red delete button appears and you can tap it to delete the file.

                    • 7. Re: Remove / Delete a file on FileMaker Go 13
                      Markus Schneider

                           ok... sorry, I misread the previous posting. You can overwrite a file

                      • 8. Re: Remove / Delete a file on FileMaker Go 13
                        philmodjunk

                             And running a quick test of this script in FileMaker 13.0v3 Advanced on windows fails to delete the file.

                        • 9. Re: Remove / Delete a file on FileMaker Go 13
                          Markus Schneider

                               on Mac OS, You can overwrite a .fmp12 file in 'documents' - when it is not open

                          • 10. Re: Remove / Delete a file on FileMaker Go 13
                            philmodjunk

                                 I can overwrite it in Windows also, but only with another file, not delete it with Export Field Contents with a $Path and no field specified. Is this different on Macs? if so, I will post this detail in Report an Issue as a possible bug as this difference between platforms should not exist (IMO).

                                 PS.

                                 I first learned this trick from a post in this forum by Fenton back when FMP 10 was the current version and I recommended it to many users. I was then chagrined to discover that it did not work when I tried to use it in a solution that I was developing for FMP 10 (windows) using a copy of FMP 11 Advanced to do the development and testing. I was quite surprised when I discovered that it did work when I used FMP 10 to test the script instead of FMP 11. At the time I chalked this up to FileMaker changing an "undocumented feature" to make it "safer" as silently (no confirmation message appears) deleting a file isn't exactly a "safe" method for deleting a file.

                            • 11. Re: Remove / Delete a file on FileMaker Go 13
                              rgordon

                                   The Export Records script step can be used to delete a file in FM GO.  To work you must export a zero found step of records.  You need add Show. All Records, then Show Omitted to your script before the Export step.  You could also switch to a layout that has a zero found set of records to accomplish this.  

                              • 12. Re: Remove / Delete a file on FileMaker Go 13
                                rouelf_1

                                     Just my 2 cents here: I created a file called Word Data, it has 2 buttons:

                                     1st button, runs a script that creates a duplicate file and gives it the name XX_Update.fmpur.

                                     2nd button, runs the script bellow resulting with deleting the file XX_Update.fmpur. This works (using FMA13) on the MAC, and using a runtime also works on the MAC and with FM Go. The file is always deleted.

                                     Hope this helps !!

                                      

                                #PURPOSE: deletes the XX_Update file

                                Allow User Abort [ Off ]
                                Set Error Capture [ On ]

                                Set Variable [ $FilePath; Value:Get ( FilePath ) ]

                                Set Variable [ $FilePath; Value:Let ( [

                                Tag = "/";
                                                    start = Position ( $FilePath; Tag ; 1 ; 1 ) ;
                                                    end = Position ( $FilePath ; Tag ; start ; PatternCount ( $FilePath ; "/" ) )+1 ];
                                                    If ( PatternCount ( $FilePath; Tag ) ;
                                                    Middle ( $FilePath; start ; end - start ) ;
                                                    "")
                                                    )]

                                Set Variable [ $Path_Update; Value:$FilePath & "XX_Update.fmpur" ]


                                #This works only if you Export Records from a zero found set.

                                Show All Records

                                Show Omitted Only

                                Export Records [ File Name: “$Path_Update”; Character Set: “Unicode (UTF-8)”; Field Order: Word Data::Field_1 Word Data::Field_2
                                                    Word Data::Field_3 Word Data::Field_4 
                                Word Data::Field_5 ] [ No dialog ]

                                Show All Records

                                Show Custom Dialog [ Title: "Delete _Update File"; Message: "The File XX_Update¶ Has Been Deleted From:¶
                                                    The Same Location As:¶
                                                    Word Data"; Default Button: “OK”, Commit: “Yes” ] 

                                      

                                • 13. Re: Remove / Delete a file on FileMaker Go 13
                                  pjreagan

                                  Thanks especially for rouelf's detailed response!  I realize this is an old thread, but to amplify/clarify...

                                  1) Using FM Go 13, the path may be easier to construct in iOS using:    Get(DocumentsPath) & (your file's name)

                                  2) Omit Multiple Records [Get(FoundCount)]  may work faster than Show All Records and Show Ommited Only, since no new data needs to be sent to your iDevice.

                                  3) In my testing anyway, this approach only worked with Exports Records NOT Export Field Contents.

                                  HTH

                                  • 14. Re: Remove / Delete a file on FileMaker Go 13
                                    philmodjunk

                                    3) was the key detail in why this did not work for me in my tests.

                                    1 2 3 Previous Next