1 2 3 Previous Next 43 Replies Latest reply on Mar 13, 2016 8:07 AM by wimdecorte

    Using External Open storage, How To Copy/Move/Rename [LONG]

    rickenbacker360

       

      Sorry for this wall of text. The more I write, the more you can understand the nuances of my issues. I’m sure I’m missing something. Thanks for any help you can give.


      (Oh, BTW, I did Download the very nice philmodjunk example file and failed to get my head around things for my needs.)

       

      In a cross-platform solution for Windows and Mac, I have need for a “Gather” function in my Documents Management Feature. Users can have a found set of legal contract parent records, each with many child documents attached (each residing in a container field). One-to-Many relationship. It’s possible for users to attach the same document more than once to a given parent. (They shouldn’t, but hey…)

       

      Prior to FMP12, I required use of a dedicated document server and users attached all files by reference. With FMP12 and the ability of FileMaker Server to store the files, I’m rewriting the feature.

       

      Now, using External (Open) storage on the FM Server [Hosted Location], for my Insert File script step, I use “Insert” not “Store by Reference” and most of my existing features work, allowing users to Open or Email the attached files.

       

      Prior to FMP12 (and my current intention), I had users make a “Temp Docs” Folder on their desktop. I prefer it to be in their Documents folder if I succeed in the rewrite.

       

      The problem I have is trying to copy/move/rename the externally stored files.

       

      Problem 1 is that I cannot get a copy of the externally stored file to reside in “Desktop/Temp Docs” at all.

       

      Problem 2 is that if I use the “Documents/Temp Docs” folder, the files do not populate “Temp Docs.” Instead, they reside at the root of “Documents” which defeats the purpose of “gathering” the files. (I want them inside a single folder.)

       

      Problem 3 is that they do not have certain “meta data” such as parent primary key and an iteration counter I’m trying to append to their existing (externally open stored) names. For example, how do I append “L12.49_0001~” to the beginning of the externally stored “FileName" to get this result: L12.49_0001~FileName.docx? And, of course residing inside either "Desktop/Temp Docs" or "Documents/Temp Docs" (preferred)?

       

      Prior to FMP12, the “Temp Docs” Folder would successfully contain gathered files similar to this:

      L12.49~FEE-0114.pdf

      L12.49_0001~Phone Number List.xls

      L12.49_0002~FEE-0114.pdf

      Where everything to the left of the tilde (~) is the originating Table designator and primary key. FTR, If the found set of documents, having many different parents has more than one iteration of a particular file for the same parent, the number counter advances. Of course, this info is merely informative.

       

      Similarly, when I use “Get (DocumentsPath)” instead of “Get (DesktopPath)” and the Documents Folder also contains a folder named “Temp Docs” the gathered files do not go inside the “Temp Docs” folder. Instead, they simply go to the root of “Documents” folder. They don’t have the stuff to the left of the tilde (~) either.

       

      Code which no longer works (but used to):

      #REQUIRED: End user must have a folder on desktop named identically: Temp Docs (If I can have this folder inside "Documents" folder, it would be great.)

       

      Go to Field [ DOCS::DocContainer ]

       

      Set Variable [ $ExportPath; Value:Get ( DesktopPath ) &

       

      "Temp Docs/" & "L" &

       

      #Get the two components of the primary key and the file iteration counter. ($Count advances through a looping routine.)


      Abs(GetAsNumber(Table A::SerialNumberPartOne)) & "." &

      GetAsNumber(Table A::SerialNumberPartTwo) &

      "_000" & $Count & "~" &

       

      Get ( ActiveFieldContents ) ]

                  Export Field Contents [ DOCS::DocContainer; “$ExportPath” ]

       

      I’ve also been using this code to no avail as I try to make things work:

       

      Get ( DocumentsPath ) &

       

      "Temp Docs/" & "L" &

       

      Abs(GetAsNumber(LEASES::SerialNumberPartOne)) & "." &

      GetAsNumber(LEASES::SerialNumberPartTwo) &

      "_000" & $Count & "~" &

       

      "[Hosted Location]/LEASES/LEASES/" & Substitute ( GetValue( DOCS::DocPath; 2 ) ; "FILE:" ; "" )

       

      #Note that [Hosted Location]… etc. above works fine for OPEN and EMAIL functions. Also note that the Substitute function grabs line 2 of “DocPath” which is, for example:

      remote:FileName.docx

      FILE:DOCS/DocContainer/-1_1FileName.docx

       

      Kindly be specific in your answer, thanks.

        • 1. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
          bigtom

          Filemaker does not advise directly moving or renaming container files, but people do it anyway.

           

          Have you considered using Get(TemporaryPath) for your exports. The TempraryPath can be used and it is cleared out every time FMP restarts. You can also run system scripts to empty the temp folder if you want to.

           

          Send your table designator and primary key as parameters to the export script

           

          set variable[ $td; GetValue(Get( ScriptParameter); 1)]

          set variable[ $pk; GetValue(Get( ScriptParameter); 2)]

          set Variable[ $filename; GetContainerAttribute(Table::Container; filename)]

          Set Variable [ $ExportPath; Value:Get ( TempraryPath ) & $td & "." & $pk & "~" & $filename

          • 2. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
            bigtom

            For the path being the same all the time I would store it in a global variable on startup.

             

            Set Variable[ $$docpath; Value:Get ( DesktopPath ) & "Temp Docs/")

            Set Variable [ $ExportPath; Value:$$docpath & $td & "." & $pk & "~" & $filename

            • 3. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
              rickenbacker360

              Thank you bigtom.  I am away from my computer for the balance of the day and cannot try any of your ideas.

               

              If it matters, I am not trying to move the original file from Filemaker server to "Temp Docs".  Instead, I am trying to have a copy placed there which has been renamed. The original is to remain in situ on FileMaker server.

               

              Also, there is a need for a persistent folder containing all of the looping script resulting files with unique meta-data, since users must then burn its contents to CD/DVD/Flash drive. From there they can get it to their client.  This is one reason I would like it nested in the documents folder so that they can finish work at 5 PM on a Friday and have it remaining there on Monday morning when they do the rest of the task, for example. 

               

              It's possible to have thousands of documents gathered during a looping routine.

              • 4. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
                rickenbacker360

                Does anything I have just written alter any of your two replies?

                • 5. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
                  bigtom

                  Nothing really changes. Just ignore the Get(TemporaryPath) stuff. I have had to do this same thing with a sub folder on the Desktop. You can even have further sub folders if you like. Just pass in the parameter.

                   

                  It is obvious you are using the export feature and this is the proper way. I just wanted to make it clear.

                  • 6. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
                    wimdecorte

                    bigtom wrote:

                     

                    Filemaker does not advise directly moving or renaming container files, but people do it anyway.

                     

                    I think the big disconnect is that FileMaker's Remote Container storage feature is NOT a document management system and that seems to be what rickenbacker360 is after.  That won't work and is potentially dangerous.  RC files should be treated as live FM files and should not be touched or moved except through interaction with the container field itself.

                     

                    The Remote Container feature is solely meant to make storage and backups more efficient.

                    • 7. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
                      rickenbacker360

                      OK.  Now I need serious consideration whether I should attempt to do this at all. My former method used a dedicated Extertal document server, not a FileMaker server.   All attached files were stored by reference and the thing was locked down pretty tight.

                       

                      If I'm reading the thread correctly, it sounds like I might be able to do this (Gather), but I should not do this. Is that the consensus?

                       

                      if any of this helps, my customer base never has more than 10 network connections and likely very few using the document manage feature at one time. My solution is for desktop use only, no FileMaker Go and no Webdirect.

                       

                      Thoughts?

                      • 8. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
                        keywords

                        I have a question for you. Is your purpose merely to store the documents and spit them out as needed, to then be worked on in other software, or simply printed and completed as hard copy? If so, then big tom seems to be putting you on the right track. However, have you considered completing documents within FM? If so, this offers a whole different approach. The documents themselves would not need to be exported, but merely referenced, each page on its own layout, with relevant fields over the spots where data is needed. Then the document would not need to be exported at all, but rather saved as a completed PDF page.

                        • 9. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
                          wimdecorte

                          rickenbacker360 wrote:

                           

                          OK.  Now I need serious consideration whether I should attempt to do this at all. My former method used a dedicated Extertal document server, not a FileMaker server.   All attached files were stored by reference and the thing was locked down pretty tight.

                           

                           

                          I don't know about your old solution to know one way or the other but it sounds like you were thinking the new FMS remote container feature would replace the referenced files on the old file server and leave you free to manipulate those files (rename / move / ...) at will.

                           

                          That's not what the Remote Container feature does at all.  The # of concurrent connections does not play a role in this; it's the core understanding of the feature.  It is NOT a document management feature like you had going before.  You SHOULD NOT EVER touch container data that is stored through this feature.

                           

                          If you need to do what you want, you have to go back to your old ways of storing by reference.  Or go with a product like 360works SuperContainer.

                          • 10. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
                            jfletch

                            Wim said: "Or go with a product like 360works SuperContainer."

                             

                            Agreed, this might be much more suited to your workflow.

                            • 11. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
                              bigtom

                              As long as the documents in the containers are exported to a folder for any renaming, editing or access from other software I do not see a problem.

                               

                              In this case it does not matter how you store the containers either (remote, reference, in the DB). In this way FM can be a document manager, but only if you treat the documents as "document images" that are only imported and exported.

                               

                              This is generally works for archived documents or workflows that force export/edit/reimport.

                               

                              Maybe I missed something but it seems OP just wants to export docs and then attach them to emails with a mail client.

                              • 12. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
                                wimdecorte

                                bigtom wrote:

                                 

                                Maybe I missed something but it seems OP just wants to export docs and then attach them to emails with a mail client.

                                 

                                I don't know... but it sounded like the OP wanted to "redirect" storage to a local folder on the client.   I totally get what you're trying to direct the OP on and I think you're doing the right thing.

                                But there might be a disconnect in the understanding in where the "master" document is stored.  But I may be reading too much into the perceived intentions.

                                 

                                If the OP's intention is to check-out a document from the server to the client then that is a no go; that's a document server feature that is not built into the FMS remote container feature.

                                • 13. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
                                  rickenbacker360

                                  OP here. Sorry I was out of touch yesterday. I see some interesting advice and perhaps sad news—and some misunderstanding of what I do in my released version of a Document Management feature vs. what I was hoping to do (still hoping?).

                                   

                                  So let me elaborate: First, the solution is for the oil industry which hires subcontractors who use my product to manage all phases of lease acquisition. When a lease is bought, the contractors might want a signed (executed) copy of the lease, along with proof of payment, plats, title reports, and the like attached to the appropriate parent lease record. These items are often prepared by sub-sub contractors and "turned in" as finished products. In addition, certain documents used to prove-up title (curative) are simply fixed digitized records available from the county courthouse. In general—they cannot be changed.

                                   

                                  Some documents might be changed if an error in a report, for example, is discovered. Fixing that report, and thus a MS Word doc, for example, would require a newly-renamed replacement document.

                                   

                                  All this being said, there is little need to include a "check-out, check-in" system.

                                   

                                  Users of my solution need to do the following (all of which are supported in my old Pre-FMP12 system.

                                  • Open

                                  • Email

                                  • 14. Re: Using External Open storage, How To Copy/Move/Rename [LONG]
                                    wimdecorte

                                    rickenbacker360 wrote:

                                     

                                    Users of my solution need to do the following (all of which are supported in my old Pre-FMP12 system.

                                    • Open

                                    • Email

                                     

                                    Thanks for clearing that up.  What you are describing works with and without the remote container feature; basically as bigtom was saying: all you need to do is use the "export field contents" feature to get a file out of the container and onto the user's computer for opening and emailing.

                                     

                                    If they change the document however, it has to be put back into the container after it is saved.  The change does not get automatically saved to the stored document on the server.

                                    1 2 3 Previous Next