AnsweredAssumed Answered

Insert File from Temporary Path Works, but...

Question asked by deninger on Oct 12, 2016
Latest reply on Oct 14, 2016 by mike_wallace_rcc

I have a simple script set up to export a PDF of the record, and then import it into a container elsewhere. Not that it matters, but the container is set to store externally on the server (secure).

 

code snipped below:

 

Print Setup [ Restore ; With dialog: Off ]

Enter Preview Mode [ Pause: Off ]

 

# create a file path in the temp folder naming the document with its UUID.pdf...

Set Variable [ $fileName ; Value: "filemac:" & Get (TemporaryPath) & SOAP::soapID & ".pdf" ]

 

# export the PDF to the path...

Save Records as PDF [ Restore ; With dialog: Off ; “$fileName” ; Records being browsed ]

 

# now navigate to the outgoing fax layout...

Go to Layout [ “FaxLog” (FaxLog) ]

Enter Browse Mode [ Pause: Off ]

 

# create a new record and insert the document into the container

New Record/Request

# note that we are INSERTING the FILE, not simply recording a reference location.

Insert File [ Insert ; Display content ; Compress when possible ; FaxLog::document ; “$fileName” ]

 

This works like a charm. Well, sort of...

 

After exit FM Pro, restart it and re-open the file I get a "The file cannot be found: <file_name_here.pdf>" in the container.

 

Insights are welcome as I am completely baffled.

Outcomes