3 Replies Latest reply on Oct 4, 2013 8:41 AM by philmodjunk

    Email PDF from iPad and save copy of PDF

    ericjlindholm

      Title

      Email PDF from iPad and save copy of PDF

      Post

           I have a very functional script that works on a desktop perfectly.  It stores a copy of the PDF in a doc archive table and then attaches it to an email.  When I try to execute it from an iPad, it does not work because of the different temp file arrangement.  Can u recommend a mod that would make it work or should I figure out how to run it as a server side script if that is possible.  Thank you!

            

            

      Allow User Abort [ On ]

      If [ not IsEmpty (Line Items::Event ID) ]
      Go to Related Record [ From table: “Line Items”; Using layout: “Delivery Receipt” (Line Items) ]

      [ Show only related records; New window ]

      Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ] [ Restore; No dialog ]

      Adjust Window

      [ Resize to Fit ]

      Show/Hide Toolbars

      [ Show ]
      Pause/Resume Script [ Indefinitely ]
      Set Variable [ $EventID; Value:Equipment List::Event ID ]
      Set Variable [ $$FileName; Value:"Delivery Receipt-SWP-" & EVENT::Event Name & ".pdf" ] Set Variable [ $$FilePath; Value:Get ( TemporaryPath ) & "/"& $$FileName ]

      Save Records as PDF [ File Name: “$$FilePath”; Records being browsed ]
                          [
      Document - Compatibility: Acrobat 5 and later ]
                          [
      Pages - Number Pages From: 1; Include: All pages ]
                          [
      Security - Printing: High Resolution; Editing: Any except extracting pages; Enable copying; Enable Screen Reader ] [ Initial View - Show: Pages Panel and Page; Page Layout: Single Page; Magnification: 100% ]

      [ Restore; No dialog ]

      Send Mail [ Send via E-mail Client; To: Event_ Contrac to Contacts::Email; Subject: "Delivery Receipt from SWP for " & EVENT:: Event Name; Message: "Hello," & ¶ & ¶ & "Attached is a delivery receipt for your event." & ¶; Attachment: “$$FilePath” ]

      Go to Related Record [ From table: “Equipment List”; Using layout: “Equipment List” (Equipment List) ] [ Show only related records ]

      Close Window [ Current Window ]
      Insert Calculated Result [ Equipment List::Delivery Receipt Last Sent; Get ( CurrentTimeStamp ) ]

      [ Select ]

      Go to Layout [ “Documents” (Documents) ]
      New Record/Request
                          Set Field
      [ Documents::Event ID; $EventID ]
      Insert File [ Documents::Document; “$$FilePath” ]
      Go to Related Record [ From table: “Equipment List”; Using layout: “Equipment List” (Equipment List) ]

      End If
                          If
      [ IsEmpty (Line Items::Event ID) ]

      Show Custom Dialog [ Message: "There are no billable line items assigned"; Default Button: “OK”, Commit: “Yes” ] End If

      Go to Related Record [ From table: “Line Items”; Using layout: “Prep Pull Detail iPad” (Line Items) ] [ Show only related records ] 

            

        • 1. Re: Email PDF from iPad and save copy of PDF
          philmodjunk

               You'll find threads that deal with this over in the FM GO forum.

               I may not be remembering correctly, but I think you have to save as PDF to just $$FileName, not $$FIlePath in FMGO and then your file path for attaching the PDF has to be something like Get (DocumentsPath) & $$FileName.

          • 2. Re: Email PDF from iPad and save copy of PDF
            ericjlindholm

                 Great! This works perfectly on most of my PDFs.  Thank you.  Since the append PDF function is not supported is there a way to run this server side?  Also is there a way to search the forums in Fm go only? 

            • 3. Re: Email PDF from iPad and save copy of PDF
              philmodjunk

                   Unfortunately, the answers are no and no. The Save As PDF script step is not server compatible and while I would love it if I could restrict searches of the forum to a specific subsection of the forum, this is not possible as far as I know.

                   What IS possible is to set up a robot file that runs as a client of the database. It could use Install OnTimer Script to run a script at periodic intervals that checks a "request" table for a request for a PDF with all the needed criteria in fields of that record for creating that PDF. It could create the PDF and then insert the PDF into a container field so that the requesting iOS user could then find this PDF in that container field or the script could email out the PDF to a specified recipient for the iOS user.