4 Replies Latest reply on Mar 14, 2016 9:18 PM by Blackburnmike

    custom name PDF emailing FMGo?

    Blackburnmike

      Hi

       

      I have found ways to do this from Filemaker in OSX but I can't seem to apply this to FMGo.

      I want to mail the current record as a PDF and to have the PDF name be derived from the value of a field (in this cas, the name of the client)

       

      Below is the script as it stands. Is this a possibility in FMGo?

      Go to Layout [ layout name ]

      Set Variable [$name ; Value: Patients::LastName ]

      Save Records as PDF [ Restore ; No dialog ; "$name.pdf" ; Crerate email ; Current record ]

      Go to Layout [ original layout ]

       

      THoughts?

        • 1. Re: custom name PDF emailing FMGo?
          CarlSchwarz

          You set a variable called $name, then you use a variable called $name.pdf in the pdf script step, they are two different variables.

          As far as I can see you are trying to add .pdf to the filename in Save Records as PDF script step and you can't do that there.

           

          Change your set variable script step to this calculation instead:

          set variable $name to:

          Get(TemporaryPath) & Patients::LastName & ".pdf"

           

          Then just use $name as the output file setting in Save Records as PDF.

          • 2. Re: custom name PDF emailing FMGo?
            davidhead

            What Carl said.

            And then, instead of using email for the PDF, you can use the $name as the specified email attachment in a Send Mail script step. This is a lot more flexible in what ends up in the email – you can calculate subject and body contents on the fly.

             

            The script becomes something like:

             

            Set Variable [ $name; Value:Get ( TemporaryPath ) & Patients::LastName & ".PDF" ]

            Save Records as PDF [ File Name: “$name”; Current record ]
            Send Mail [ Send via E-mail Client; To: Patients::Email; Subject: "Your Results"; Message: "Hi " & Patients::FirstName & "¶Please find your results attached.¶Let us know if we can assist further."; Attachment: “$name” ]

             

             

            Cheers, David

            • 3. Re: custom name PDF emailing FMGo?
              Blackburnmike

              Thanks David and Carl

              Will give these a go and let you know how it works out.

              Mike

              • 4. Re: custom name PDF emailing FMGo?
                Blackburnmike

                Thanks guys - this works a treat.

                Mike