13 Replies Latest reply on Mar 23, 2011 8:24 AM by GianandreaGattinoni

    Save As PDF the Sendmail... How do i?

    Stuee

      Title

      Save As PDF the Sendmail... How do i?

      Post

      Hi.

      I want to set up a button to save the record as pdf to a folder either on my local drive c:/quotes or network   //BP_NAS/Work/Quotes

      I would also like the pdf to be called the job number from field "Ordering::Order ID"

      I did see this script and tried changing it but it keeps saying a error on the first line and cant work out what.

      Set Variable [$FilePath ; Value: "file:" & Get ( /C:/Quotes ) & Ordering::Order ID & ".PDF"]
      Save Records as PDF [Restore; no dialog; $FilePath ; current record]

      If somone can rewrite it or point out where im going wrong i would appreciate it.

      Thanks

      Stuart

      Here Is the link to how i have this setup.

      when i press the button it opens the dialog to save this record, i press ofk and it does nothing.

        • 1. Re: Save As PDF the Sendmail... How do i?
          GianandreaGattinoni

          If you use a fill path you need to specify:

          filewin:/driveletter:/directoryName/fileName

          or

          filemac:/volumeName/directoryName/fileName

          See the help file to see how to specify path in filemaker

          • 2. Re: Save As PDF the Sendmail... How do i?
            Stuee

            Thanks Gianandrea.

            I did read the help file but im not experienced enough to work out variables thats why im hoping someone can just change the script above to what it should be.

            cheers


            Stuart

            • 3. Re: Save As PDF the Sendmail... How do i?
              GianandreaGattinoni

              it should be

              Set Variable [$FilePath ; Value: “filewin:/C:/Quotes/” & Ordering::Order ID & ".PDF"]

              • 4. Re: Save As PDF the Sendmail... How do i?
                GianandreaGattinoni

                sorry Stuart, I forgot the network.

                Set Variable [$FilePath ; Value: “filewin://BP_NAS/Work/Quotes/” & Ordering::Order ID & ".PDF"]

                Gianandrea

                g.gattinoni@gmail.com

                • 5. Re: Save As PDF the Sendmail... How do i?
                  philmodjunk

                  An undocumented trick is to use "file:" in place of FileWin and/or FileMac. For the file path used to save a PDF, this results in an expression that can work equally well for both Macs and Windows, if you can make the rest of your file path the same for both platforms. That's where get functions that compute file paths to the desktop or temporary items can become very useful for these type of jobs.

                  Unfortunately, this trick does not work in every place here you might compute a file path, so test carefully when using in other contexts.

                  • 6. Re: Save As PDF the Sendmail... How do i?
                    Stuee

                    Thanks again,

                    It doesnt seem to do anything though,

                    What i did was, setup button, perform script, new script, chose save as pdf, edit the file save as settings and put it in there.

                    is that correct?

                    • 7. Re: Save As PDF the Sendmail... How do i?
                      philmodjunk

                      Try posting the complete script so we can see it. You need at least two script steps, one to assign a value to the variable and one to use it in the save as PDF step.

                      1. You can upload a screen shot by clicking the edit link to your original message and uploading it there
                      2. You can upload a screen shot to a file share site and post the download link to a new response you post here.
                      3. You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF.
                      4. If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
                      • 8. Re: Save As PDF the Sendmail... How do i?
                        Stuee
                        I have added the link to the first post
                        • 9. Re: Save As PDF the Sendmail... How do i?
                          GianandreaGattinoni

                          You do not have to insert script instructions in the specification of the output file.

                          The Email-Quote script should be:

                          Set Variable [$FilePath ; Value: “filewin:/C:/Quotes/” & Ordering::Order ID & ".PDF"]

                          Save Records as PDF[File Name:“ $FilePath”;Records being browsed ]

                          and when you specify the output file just insert

                          $FilePath

                          That’s all

                          • 10. Re: Save As PDF the Sendmail... How do i?
                            Stuee

                            Thanks got it working.

                            Now the next bit, how do i get that file to sendmail?

                            i see it has a attatch to emial in filesetup where i put $filepath but,

                            what i want it to do is auto setup the email so it gets the email address from the Ordering::Customer Email  and i can get the subject to show the job number and quote (ie the filename of the pdf) also with my business details at the end of the email?

                            ill keep looking around for info but if your quicker at replying then me finding i would appreciate it.

                            cheers for all your help.

                            • 11. Re: Save As PDF the Sendmail... How do i?
                              GianandreaGattinoni

                              Use the Send Mail script command:

                              Each field can be filled using calculation: i.e. to: Ordering::Customer Email and so on (just click on the arrow)

                              When you check Attach file just insert the filename $FilePath.  Attention, you must be in the same script where you have saved the PDF, otherwise you have to use $$ instead of $ for define the variable.

                              • 12. Re: Save As PDF the Sendmail... How do i?
                                Stuee

                                Your a legend. All sorted now.

                                I do have a Q or 2 now though with the send mail.

                                I use a program called Chaos Intellect in replacement than outlook at its heaps better but when it sends to the software it only sends the attachment and no other details, i set outlook at default and tried again and it all worked ok but it dont want to use outlook.

                                I tried SMTP and filled in the details but again it opened the email software.

                                where does the temp file goto thats sent to the mail client so i can get it and try emailing to Chaos to see if they can incorporate it in there software.

                                smtp would be better though.

                                Cheers

                                Stuart

                                • 13. Re: Save As PDF the Sendmail... How do i?
                                  GianandreaGattinoni

                                  I do not know CHAOS.

                                  In any case, if you set up correctly to send via SMPT server you should not open any mail software.

                                  Check if you have filled all the fields of SMTP set up as the one you have in your Outlook account, for the address mail you decide to use.