4 Replies Latest reply on Jan 30, 2012 8:44 AM by NanetteHartley

    Container question

    NanetteHartley

      Title

      Container question

      Post

      I have a container field named "Ash."  I would like to be able to load either an Excel template link or a blank Excel workbook link into the container using the "On Object Modify" script trigger.  I would then like to have them do the data entry they need to do, and then use "Save As" in Excel to save the file in the right location.  I then want to put a link to that new file in the container for storage purposes.  I really don't want to have to make them create the file before doing this.  Is there any way to set a script, or a series of scripts, to do this?  

       

      I also have a script that runs off the same box for "On Object Save," to record the user name and date of the entry in the associated fields.  

       

      Thanks!

        • 1. Re: Container question
          philmodjunk

          Before looking at scripting details and whether OnObjectMOdify is the best script trigger to use here, let's make sure that I understand what you want to be done with that excel file.

          1) YOu want to copy an existing file

          2) you want the new copy opened so that users can add/edit data in this file.

          3) the reference to this modified copy is then to be stored in the container field?

          Will the original copy of the file be left unchanged?

          • 2. Re: Container question
            NanetteHartley

            Happy to clarify.

            1.  Yes, an existing file should be put in and left unchanged

            2.  Yes, I want the new copy opened so the users can add/edit data.

            3.  Yes, the reference to the new, modified copy (and it's save location) should be stored in the container field. 

             

             

            Thanks so much!

            • 3. Re: Container question
              philmodjunk

              A script can do this.

              Use a container field to store a reference to the original file. Use a second container field--possibly in a different record or even a different table--to store the reference to the new copy.

              Export Field Contents can create a copy of the original file and export it to the "save" location where you want the file to be saved. An option on this script step can cause the exported copy to open automatically so that the user can modify it.

              This newly created copy can then be inserted with a store by reference option to store the location of this new copy.

              The one thing that this does NOT allow, is the option for the user to decide where to save the new copy as the script sets that up for the user. If the user uses "Save as.." from the Excel file, there's no simple way for FileMaker to be able to determine the location of such a new copy of the file.

              • 4. Re: Container question
                NanetteHartley

                Sorry this took so long - we went live last week and I have been supporting the new users.  This works great!  I just need to get all of the container fields I have scripted to use it - and that takes time.  Thanks so much for your help! Smile