3 Replies Latest reply on Apr 7, 2015 11:34 AM by philmodjunk

    Saving a file to computer



      Saving a file to computer


      Working with "Save records as PDF" currently I'm setting a variable and attempting to save a file with the Invoice number in the name.

      "filewin:/C:/Users/TEMP.FLUID.000/Documents & "/"Invoice " & Invoices::INVOICE_ID & ".pdf"

      with this I get a "?60.pdf" could not be created on this disk error.

      I'm sure it's syntax, any thoughts?

        • 1. Re: Saving a file to computer

          You are missing a quote and an ampersand (&) in your calculation.

          This puts the / character outside the quotes and FileMaker then interprets this character as the division operator and you get null divided by null which produces the ? result.

          Here's a corrected expression that won't produce the ? result but it is still up to you to verify that the resulting path is valid:

          "filewin:/C:/Users/TEMP.FLUID.000/Documents" & "/" & Invoice " & Invoices::INVOICE_ID & ".pdf"

          • 2. Re: Saving a file to computer

            That worked great, Thanks.

            Also, I'd like to "automatically" send the pdf via email, is SMTP the best/ or only way to do that?

            By automatically, I mean without user interaction.

            • 3. Re: Saving a file to computer

              Send mail can use the user's client email application to send out such an email with your PDF as an attachment. This need not involve any user interaction, but you do have to check Filemaker Help for what apps are compatible and see what client application is installed on the user's machine if you choose to use that method to send out email.