6 Replies Latest reply on Apr 8, 2014 8:40 AM by philmodjunk

    Issue with File Maker Email function

    OllieProm

      Title

      Issue with File Maker Email function

      Post

           Hi there, I've been trying to write a script in my database which allows the user to save the current record displayed on the page as a PDF file and email it to the client linked to said record. While at the same time automatically entering two seperate numerical values into the message field in the email, (the customer number, and estimate number) which I'm struggling to do. These numbers both correspond to their own fields which are on the record, I just can't seem to display them both without errors. I also have the invoice number displayed automatically on the subject line of the email however this seems to work properly. 

           I've attached an Image showing my issue and would appreciate any help,
           Thanks.

        • 1. Re: Issue with File Maker Email function
          OllieProm

               Here is image.

          • 2. Re: Issue with File Maker Email function
            philmodjunk

                 JobSheets::clientCode & " " & Jobsheets::estimate number

            • 3. Re: Issue with File Maker Email function
              OllieProm

                   Brilliant thank you, that has made both vales appear, I'd also like to automatically set text next to them if this is possible? So I can tell the user in the Email that this is the client code and estimate number, for example,

                   "Client Code 1 
                   Estimate Number E50354"

                   There is also the matter of the PDF file, as I mentioned before the script only currently allows me to save the record as a PDF to a specified location first, and then my script will look up that file path, is it possible to make it automatically save the page as PDF and attach it without me needing to specify a file path?

                   And I did already try using the option when you use the "Save as PDF" command to "attach to email" but then I can't bring all these email options over with it.

                   Thank you for the help so far.

              • 4. Re: Issue with File Maker Email function
                philmodjunk

                     "Client Code " & JobSheets::clientCode & "¶Estimate Number " & Jobsheets::estimate number

                     You need to specify the file path. FileMaker needs to know both what name to give the new file and where to put it.

                     Why is specifying the file path a problem?

                     You may find that using Get ( TemporaryPath ) is a useful function for specifying the file path for your PDFs as PDFs put in the temporary folder will not be retained so you won't build up a large group of PDF files over time if you save them to that folder.

                     for more on $Path variables and the script steps that can use them, see: Exploring the use of a $Path Variable in Scripts

                • 5. Re: Issue with File Maker Email function
                  OllieProm

                       Great thank you, that worked again, it looks exactly as I hoped it would.

                       It's not necessarily a problem to specify a file path, I would just like to make it as fast as possible with the user having to use minimal input, and at the click of a button could have an email all ready to send without having to do anything else. But I suppose that may be a slightly unrealistic expectation, and I'll have to do it the slightly longer way.
                       Thank you for all your help.

                  • 6. Re: Issue with File Maker Email function
                    philmodjunk

                         There is no reason that the user need specify the location and name of the file being produced by Save As PDF, Your script can compute a path without needing any input from the user.