Is the PDF created?
One usually specifies more than just the file name for the $Path variable. One also specifies a file path to a location where the file is to be saved.
See the script example in this thread: Found Sets to PDF with unique file names
Hi PhilModJunk, thanks for your quick reply.
The PDF is created, in the same folder as where my database is.That is perfect; I do not need to specify a different path for it. The e-mails are also sent to the correct addresses and with the correct text. However, no PDF is attached so that seems to be a problem.
Also, when sending the e-mails you have to confirm that you authorise the e-mail to be sent, since it is not a direct user prompted action. I'm guessing this is an Outlook feature and not an FM one, but have people found a solution for this?
Perhaps send mail executes before the PDF has actually been saved. If you have a complex layout and/or a lot of records in the found set being used to generate your PDF, the script may start the "save to PDF" process and then goes on to Send Mail before it completes.
Try inserting a Pause/Resume script step in between the two script steps and see if that makes a difference here. If so, you can specify a 1 second pause or so to give the system time to create and save the PDF before sending the email.