4 Replies Latest reply on Apr 28, 2016 4:12 AM by erolst

    Script to save to file.

    FM_DM

      I recently had a problem with my computer which required a full system restore. Unfortunately after my system was restored my documents were lost. I have a script on a server based filemaker inventory system which saves a copy of a report to a local file when I click button.

      However now when I click the button I am getting a pop up which says the following:

      "Stocktake_27_04_2016.pdf could not be created on this disk. etc etc"

       

      I use the following script for this

      sock tkae end.PNG

      is there something I'm missing here? could it be a security issueon my PC or have I made a scripting error somewhere?

        • 1. Re: Script to save to file.
          rgordon

          Not sure if this is the problem but you have a forward slash between StockTake and Stocktake. The rest of your slashes are backward slashes.

          • 2. Re: Script to save to file.
            FM_DM

            Yes I realized this after I had put this up however changing the slashes has not affected it .

            • 3. Re: Script to save to file.
              coherentkris

              I would suggest that if the script worked before the restore and does not work after the restore then the only logical conclusion is that the OS is preventing the action due to permissions issues.

               

              Furthermore steps 2 and 3 in your script are misplaced as any sorting should be done after find is performed.

              • 4. Re: Script to save to file.
                erolst

                And it's unnecessary to use Show All Records[] …

                 

                Here's an alternative:

                 

                Enter Find Mode

                # [ do it first, so no records need be loaded in the GtL target table ]

                Go to Layout [ Items ( Items ) ]

                Set Field [ … ]

                Set Error Capture [ on ]

                Perform Find [ no restore ]

                If [ not Get ( FoundCount ) ]

                # [ error handling ]

                End If

                # [ process found set; any sorting should only happen now ]

                 

                If you use Enter Find Mode/Set Field/Perform Find, you shouldn't use PF with Restore – that will get confusing …