4 Replies Latest reply on Feb 19, 2013 4:04 AM by renner.david.b

    Insert PDF script step for FileMaker Go doesn't work.

    renner.david.b

      Summary

      Insert PDF script step for FileMaker Go doesn't work.

      Product

      FileMaker Go

      Version

      FM Go 12 Developer's Guide is unclear as to support for the Insert PDF script step.

      Operating system version

      FM GO 12

      Description of the issue

      Script is creating a PDF and attaching it to email for printing (which it does ok) then the PDF (referred to with Global variable) is to be inserted into a container field via script step.

      Steps to reproduce the problem

      Create record in database, create script to save the record to pdf (using global variable reference), attach pdf to email and then insert the pdf into a container field in same record.

      Expected result

      pdf created, pdf attached to email, pdf inserted into container field.

      Actual result

      pdf created, pdf attached to email, pdf file reference placed in container field (which was not checked in setup of the interactive container field). No pdf file placed in the container field of the record.

      Exact text of any error message(s) that appear

      None apparent.

      Configuration information

      Script Step info:
      Go to Related Record [ From table: “Ext_Inspection”; Using layout: “Ext Inspection Violations_1st Letter” (Ext_Inspection) ]  [ Show only related records; New window ]
      Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ]
      Set Variable [ $$ExtOutput; Value:Get ( TemporaryPath ) & "ExtLtrViolations.pdf" ]
      Save Records as PDF [ File Name: “$$ExtOutput”; Current record ]
      Send Mail [ Send via E-mail Client; To: "pubworksbldg1@hpeprint.com"; CC: "kpodmore@florissantmo.com"; BCC: "renner.david. b@gmail.com"; Subject: "First Letter and Violations List attachment" & " For " & Property Addresses::Full_St_Address; Attachment: “$$ExtOutput” ]
      Set Field [ Ext_Inspection_Processing::Ext_PDF_Letter; $$ExtOutput ]
      Insert PDF [ “$$ExtOutput” ]

      Workaround

      email cc to clerk who uses FMP 12 and they drag the pdf from mail to container field.

        • 1. Re: Insert PDF script step for FileMaker Go doesn't work.
          philmodjunk
               

                    reference placed in container field (which was not checked in setup of the interactive container field). No pdf file placed in the container field of the record.

               Insert PDF requires that the target container field be present on the current layout and be configured for Interactive content.

               Drag and drop does not use Insert PDF to put the file in the container which is why you clerk does not encounter this issue.

               Here are the Notes entries from the Filemaker Help entry on Insert PDF:

               Notes
                                                                           
                              
                                    •
                         
                              
                                   If there is no active container field on the layout where the script is being performed, Insert PDF returns an error code that can be captured with the Get(LastError) function.
                         
                
                                                                           
                              
                                    •
                         
                              
          This script step works only with interactive containers. For more information, see Specifying formats for container fields.
                         
                
          • 2. Re: Insert PDF script step for FileMaker Go doesn't work.
            renner.david.b

                 Phil ... thx for your post,

                 In this case, I think there is a gap in my script logic.

                 My script, at the time of attemped insert, is on the detailed layout with this container field (The field was defined as interactive via the layout inspector data tab). 

                 The Insert PDF step does not have a target field associated with it. Do I need to create a script step that somehow directs the Insert PDF step to put the PDF file into the container field?

            • 3. Re: Insert PDF script step for FileMaker Go doesn't work.
              philmodjunk

                   For Insert PDF to work, you need to make sure that your interactive container field has the focus before you insert the PDF. Go to Field or Go to Object (if the field has been given an object name) can be used to put the focus into the correct field before Insert PDF is executed.

              • 4. Re: Insert PDF script step for FileMaker Go doesn't work.
                renner.david.b

                     Phil -- Had to set the file as permanent file on device, but with your tip it working.

                     Thx Dr