3 Replies Latest reply on May 11, 2016 2:59 PM by user19752

    Insert PDF script step does not work without adding an image tag

    crobrocker

      Hello,

       

      I'm working with a container field that is stored externally. I would like to strictly control the file names used when a user uploads a file. If they upload (via drag and drop) a file and the file name does not match the desired (a calculated field on each record)  name I'd like to rename that file and store it externally.

       

      I've scripted this step by first exporting the file to a temporary path with the file name I want then insert that file back into the container field. The first part of the script works just fine, exports the file with the new name but when I attempt to import the file I get an error "The file [New File Name] could not be found and is required to complete this operation". I know the file exists because upon export I automatically open it. If I add "image" to the insert pdf function the file is uploaded to the container field but that does not copy the file to the external storage and thus is not available in the database on the rest of the network.

       

      Here is the script steps that result in the error:

      Set Variable [$NewFileLocation ; Value: Get(TemporaryPath) & OrderItems::cs_FileName ]

      Export Field Contents [OrderItems:cf_AdImage ; "$NewFileLocation"]

      Go To Field [Select/perform ; OrderItems::cf_AdImage]

      Insert PDF [Reference; "$NewFileLocation"]

       

      Here is the script steps that do insert the file but does not copy it to the External Storage

       

      Set Variable [$NewFileLocation ; Value: Get(TemporaryPath) & OrderItems::cs_FileName ]

      Export Field Contents [OrderItems:cf_AdImage ; "$NewFileLocation"]

      Set Variable [$NewFileLocation ; Value: "image:" & Get(TemporaryPath) & OrderItems::cs_FileName ]

      Go To Field [Select/perform ; OrderItems::cf_AdImage]

      Insert PDF [Reference; "$NewFileLocation"]

       

      We are working with FM 14 and FMS 14 in a 100% Mac environment.

       

      Thank you in advance for any help you provide.