3 Replies Latest reply on Jul 28, 2014 12:21 PM by philmodjunk

    Figuring out where a file was saved.



      Figuring out where a file was saved.


           So, I'm saving a record as a PDF.

           I have 3 different possible locations it could go to.

           What I need to do is figure out how to tell the user where it ended up. Because it might be on the S: drive, or it could be in their Local Documents folder, Depending on if it errors or now.

           However, there doesn't seem to be a way to capture the 800 Error and not have the box pop up.

           Anyone else have any ideas on how to pull this off?

        • 1. Re: Figuring out where a file was saved.

               If possible, I'd specify that the files all be saved to a specific folder on the system where they can then look to find the PDF file. You can use a $Path variable to specify that the file be saved to that folder.

               A more sophisticated approach is to set up your script to compute, say 4 different file paths to four different locations and then put some controls on a layout where the user selects one of the four locations and then the script uses that user selection to determine what file path to set the $Path variable to before saving the PDF.

               If you've never used Save As PDF to save to a variable before: Found Sets to PDF with unique file names

               To learn more about $Path variables and the script steps that use them, see: Exploring the use of a $Path Variable in Scripts

          • 2. Re: Figuring out where a file was saved.

                 Yeah, I have done this.

                 I was trying to do an IF(Get(LastError) = 800 or Get(LastError = 26)) to see if I could capture the error and make it try the next path. But it appears that setting error capture to "On" doesn't actually suppress all the dialog boxes. I was going to just make it run through the if statements to make it try the three different paths and then display a custom dialog showing where it was saved. But that isn't working like I thought it would.


            • 3. Re: Figuring out where a file was saved.
              FileMaker Error handling is very inconsistent. actions that attempt to create a new file, such as Save As PDF that generate an error, are not supressed by Set Error capture as they should. Thus, you have to use other means. I've pointed out the need for improvement in a recent post to Feedback that you can read and use as a basis for your own feature request posts to FileMaker if you are interested: http://forums.filemaker.com/posts/56b3613440