6 Replies Latest reply on Mar 26, 2016 7:13 AM by disabled_morkus

    Filepath

    bruns

      Hello, I know I have something wrong, I have a script were I have a container field and I have a button below "Open File".  By the way FM 14 Adv.  I want to click the button and open the pdf in the container field.  Here is my script, but I am getting a disk error.

      I am enclosing my script and the error message.  I have seen how to fix this before but cannot remember.  Any help is appreciated.

        • 1. Re: Filepath
          erolst

          I think you put the $finalPath reference in the Path window into quotes (that's why you see it in wrapped in two pairs of quotes in the script code), which you must not do, since it is a reference, rather than a string.

          • 2. Re: Filepath
            bruns

            Thank you, I would have never seen that.  Works great now.

            • 3. Re: Filepath
              bruns

              Something still not right.  I have my manuals in a portal, and when I hit the open button, It is only opening one of the manuals, no matter which open button I click.  It only opens manual 2, Any ideas?

              • 4. Re: Filepath
                rgordon

                What relationship is your portal based on?  Your script indicates it the Manuals relationship.  If it is difference you need to change the fields in your script to match the correct relationship.

                • 5. Re: Filepath
                  bruns

                  Thank you, I am having brain fart after brain fart this morning.  I think I need to step back and go do something else for a while.  Work great now thank you.

                  • 6. Re: Filepath

                    I had a recent issue where I was trying to append the date to the filepath. And, as expected (now), I got a similar error since FileMaker couldn't create a file with the "/" between the date parts.


                    Fortunately, the solution was simple. I just used the SUBSTITUTE command to change "/" for another character that wouldn't be misinterpreted as a file path.

                     

                    So, Substitute(Get(CurrentDate); "/" ; "-")

                     

                    was all I needed to change when I broke up the "file:" string to append the date to the filename.

                     

                    HTH

                     

                    - m