3 Replies Latest reply on Aug 25, 2016 3:48 PM by TSGal

    Export Field Contents Not Generating Error In Script


      Product and version FileMaker Pro 15.0.1 x64

      OS and version Windows 7 Professional

      Hardware HP Z440 Workstation (and others)


      I am using the Export Field Contents step in a script to save the file stored in a container field to a network directory.  The script works fine normally unless a file is currently open when it attempts to overwrite it.  If you attempt this using only a single step button, a dialog box appears to alert you that the file could not be created on the disk.  However, when this step is part of a longer script, the error is completely hidden from the user.  It does not matter whether Set Error Capture is turned on or off.  Get ( LastError ) always returns a 0 even when the file fails to get saved.  There is no indication I can find to let the user know that the file did not get saved, which leads to the latest files not being posted on the network.


      I am able to use the BaseElements extension to properly display errors, but this should be handled by the built-in FileMaker function.

        • 1. Re: Export Field Contents Not Generating Error In Script



          Thank you for your post.


          I am unable to replicate the issue using FileMaker Pro 15.0.1 under both Windows 7 and Mac OS X 10.11.6.  Here are the steps I took:


          1. I created a file "Test.fmp12" that contains a Container field "Container".

          2. I added one record, and inserted the file "Test_1.fmp12".

          3. I created a script "TEST" with the following script steps:

            Set Variable [ $file ; Value: "file:" & Get (DesktopPath) & GetContainerAttribute ( Container ; "filename" ) ]

            Export Field Contents [ Container ; "$file" ]

            Show Custom Dialog [ Get ( LastError ) ]


          4. I put "Test_1.fmp12" on the Desktop and opened it in FileMaker Pro 15.

          5. I returned to "Test.fmp12" and executed the script.

          6. I get an error that it can't be created, and when I click OK to dismiss the dialog box, I get the Custom Dialog showing Get ( LastError ) = 800.


          7. I closed Test_1.fmp12, and moved it to a network drive.  I opened the file on the network drive.

          8. I changed the Set Variable script step and replaced "Get (DesktopPath)" with the full network drive path.

          9. I executed the script, and I get the same error.


          Let me know what I am doing differently than you so I can replicate the issue.



          FileMaker, Inc.

          • 2. Re: Export Field Contents Not Generating Error In Script

            I am specifically using PDF files in the container and filewin: for the

            path.  Otherwise, the script looks similar to mine.

            • 3. Re: Export Field Contents Not Generating Error In Script



              When PDF files are opened, they are loaded into memory.  The original file can be overwritten at any time.  When you save the opened PDF, then it will overwrite the original file.  This is why you are not getting an error message.



              FileMaker, Inc.