Try it this way:
Thanks Phil. I just changed the functions like you suggested, and it now works great from the remote site.
Don't fully understand what I changed, but the pdf file no longer goes in my desktop database folder & the remote has the attachment. Would you briefly explain what I changed?
Thanks again for your quick response that solved my problem.
The PDF is not saved in the user's Documents folder. That's the path specified in the $PDFpath variable and the save As PDF now uses that variable to determine the name and location of the file created by the Save As PDF step.
Before, the $PDFpath variable was not being used when the PDF was created. You had specified $FileName--a variable that only contained the name of the file.
WHen a file path only specifies the filename, FileMaker interprets that as a "relative file path". This will be a path that is relative to the location of the actual database file. If you were getting a PDF on your desktop, I must assume that your database file was also located on your desktop.