4 Replies Latest reply on Apr 4, 2014 10:12 AM by JosephSchueller_1

    Container references to files on a virtual drive

    JosephSchueller_1

      Title

      Container references to files on a virtual drive

      Post

           Hi.

           We've got PDF files stored on a server that is split into virtual drives. Some of the filemaker users map to virtual drive "J:" and some to "K:". They are really the same network location, different only in name. I don't know why the powers that be set the network up this way, it's a big place. 

           This makes a problem when I insert a PDF to a container field; the file path references drive "K:", so the folks who map to the same file via "J:" can't see it. 

           This can be overcome by changing the references to include the fully qualified domain of files, but the Insert PDF script step defaults to using the file path containing the virtual drive. 

           Has anybody encountered this or possessed of an idea how to force the script step to use the absolute reference to the file location?

            

           thanks

            

            

        • 1. Re: Container references to files on a virtual drive
          philmodjunk

               If you are using FileMaker 12 or newer, see if setting up the container field to use "external storage" will work for you. It allows you to insert a copy of the file and then FileMaker transfers that copy to the external storage location. FileMaker manages access to the file so you don't have to map/mount to the file's location on each client computer.

               If you are using an older version of FileMaker or other considerations require that you not use external storage, there are two different tricks that you can work with, either separately or in combination to get this to work:

               On the layout where users insert new files, a script--perhaps performed by OnObjectModify on the container field, can extract the file path in the container field, compute the "fully qualified file path" that connects to the same file, set a $Path variable to it and can then re-insert the file from that location.

               A calculation field can have "container" as the result type. This calculation field can take the file path info from a container field and compute a different file path--such as using the J: drive letter instead of K: or by computing the fully qualified path to the file. You can't insert a file into such a calculation field, but you can use it to display the file.

               For more on $Path variables, the file path info inside "by reference" container fields and the script steps that can use this info, see: Exploring the use of a $Path Variable in Scripts

          • 2. Re: Container references to files on a virtual drive
            JosephSchueller_1

                 Thanks Phil,

                 Using your advice I was able to make it work. Here's how I set it up:

                  

            -Users initiate a script to add a PDF file reference 

            -Open file dialog takes them to the networked virtual drive

            -PDF reference inserted into container

            -Based on GetAsText(container), a calc field re-formats the reference syntax to "point" to the fully qualified domain instead of the virtual drive 

            -Set Variable($Path;CalcField)

            -Insert PDF (reference; "$Path")

                  

                 Does this seem ideal to you? I feel like I could simplify it somehow.

                  

                  

            • 3. Re: Container references to files on a virtual drive
              philmodjunk

                   The only thing that I see that could be simplified is that you probably don't need GetAsText (container) as you can usually refer directly to the container field to access the text of the file reference.

              • 4. Re: Container references to files on a virtual drive
                JosephSchueller_1

                     thanks again, i'll give that a shot