AnsweredAssumed Answered

Temporary File Insert Into Container Issue

Question asked by SethRedlus on Jan 1, 2018
Latest reply on Oct 28, 2018 by

Howdy all-


Having a bit of an issue I can't wrap my mind around. I have a process whereby I create a PDF of a layout, and then I would like to insert the PDF after it's produced into a container field. I have tried this several ways - inserting as a file, a PDF and an Image. I'd ideally like to have it visible as an image so that I can see the produced PDF in the layout without much difficulty - it's always a 1-page PDF. I tried interactive, and it doesn't seem to play well for whatever reason - like I see a progress bar at some times, but rarely the scaled-to-fit PDF.


The biggest issue I'm having though is that in the script below, I get an error saying the file can't be found after it's created. I use the same variable to create the file as I do to import it - so not sure where the mismatch is. Anyone have any ideas?


The Script:

Go to Layout [ “TitleSlides” (Sessions) ]

# Construct the FileName. No special characters here - just hyphens and text.

Set Variable [ $FileName ; Value: Get(TemporaryPath) & "T-" &  Substitute ( Sessions::Room Name ; " " ; "" ) & "-" & Get (RecordNumber) & "-" & Substitute ( Substitute ( GetAsText ( Sessions::Session Time ) ; " " ; "" ) ; ":" ; "") & ".pdf" ]


Save Records as PDF [ Restore ; With dialog: Off ; “$FileName” ; Current record ]

Go to Layout [ original layout ]

Go to Field [ ContainerField ]

Insert Picture [ “$FileName” ]

Commit Records/Requests [ With dialog: Off ]


The Error:

This generates an error of: The File --- could not be found and is required to complete this operation.Screen Shot 2018-01-01 at 8.42.23 PM.png


I had read some other folks suggestions to insert a pause to allow the file time to be written - tried that and didn't have much luck either. Any ideas what might be going on?


Running FMPA 16 (Mac) with a file hosted on FM Server 16 (Windows)