5 Replies Latest reply on May 2, 2013 7:03 AM by philmodjunk

    Problems with container fields

    TimHorton

      Title

      Problems with container fields

      Post

           Hello

            

           I have a problem with container fields.

           If I insert a file by right clicking and I click on “Store a reference to the file”, I can then access it by double-clicking it, and it opens fine. BUT, it does not save the file externally, even though the field is correctly setup for it.

           If I create a script to insert the file, it does save the file externally. BUT I cannot open the file by double-clicking on it, or any other way I know…

           Basically, I want to be able to save this file externally and open it when needed from FM12. Whether it’s by double-clicking on it or any other way, I don’t mind.

           Can you help?

        • 1. Re: Problems with container fields
          philmodjunk

               Use Export Field Contents to open the file in the container field. You can click the field to select it and then select this option from the Edit menu or you can use it in a script so that clicking a button opens the file.

          • 2. Re: Problems with container fields
            TimHorton

                 But then I have to save this "new" file somewhere...

                 Is this the only way?

                 Thanks

            • 3. Re: Problems with container fields
              philmodjunk

                   It's pretty much the only way if you are not using inserted files inserted with the Store a Reference option.

                   With some files and the container field "optimized for interactive use" you can view the contents of the file--such as a PDF file directly in the container field.

                   But with Export Field contents, the location you specify for the exported file can be the temporary items folder on your computer and then you will not need to delete these files at a later point as they will not persist in the temporary folder.

                   You may find this thread and the "exploration" file that you can download from it helpful: Exploring the use of a $Path Variable in Scripts

              • 4. Re: Problems with container fields
                TimHorton

                     I tried the export solution and it works pretty well, but...

                     In my script, I use a variable to give the exported file a new name and path to save it in a temp folder.

                     The problem is :

                     1- How can I name it the same name as the original file? Can I do this?

                     2- Because the way I can make it work, it renames it but then forgets the extension, hence the type of file... If I inserted a PDF, then it will open a PDF only if I rename it as a PDF in my script. If I do, then the JPG files won't open. Same with Word files... etc...

                     Do you see a way around this problem?

                     Thanks

                      

                      

                       

                • 5. Re: Problems with container fields
                  philmodjunk

                       Please check out the Exploration file that you can download from the other thread that I suggested. It includes example calculations for extracting the file path and the file name from a container field. The calculation for extracting the filename works regardless of the insertion method and storage options specified.