4 Replies Latest reply on Feb 24, 2014 7:05 AM by DavidKinally

    Creating a script to send PDF of record on iPad app

    DavidKinally

      Title

      Creating a script to send PDF of record on iPad app

      Post

           So i have an iPad layout on my database. I have created a button which goes to an additional layout which contains information based on a number of tables.

           I would like this one layout to be sent via the send mail script (attached as a pdf) 

           The send mail will take the email address from the record and email it with the PDF attached. How can i do this?

            

           The current script i have which is sending the email but not attaching a PDF is as a screen shot attached.

            

           Thanks

            

            

            

            

                      
                     Preferences
      §
      1
      2
      3
      4
      5
      6
      7
      8
      9
      0
      -
      =
      Backspace
                           
      Tab
      q
      w
      e
      r
      t
      y
      u
      i
      o
      p
      [
      ]
                                
      Return
                                
                           
      capslock
      a
      s
      d
      f
      g
      h
      j
      k
      l
      ;
      '
      \
                           
      shift
      `
      z
      x
      c
      v
      b
      n
      m
      ,
      .
      /
      shift
                           
                                
                               English
                                     
                                     
      alt
      alt
                           
                      
                     Preferences

            

      Screen_Shot_2014-02-20_at_13.27.52.png

        • 1. Re: Creating a script to send PDF of record on iPad app
          philmodjunk

               Can you verify that the PDF is actually being created?

               One detail that I spot right off is that Go To Related Records will fail to change layouts if there are no related records in Support Call for the current record in whatever layout you are on when you start this script. The rest of the script steps will then execute just as though there was not GTRR step in your script.

               I'd recommend either checking for related records in Support Call just before the GTRR or checking for an error code immediately after it so that you can halt the script and tell the user that there are no support records to email for the current client.

          • 2. Re: Creating a script to send PDF of record on iPad app
            DavidKinally

                 Hi Phil. 

                 I have checked and it does in fact navigate to the correct layout with the right information but still does not attach a PDF. the email id creted fine and i can see on the iPad that a PDF is being created. but not attaching to the email when the email box pops up.

                  

                 Thanks

                  

                 David

                            
                           Preferences
            §
            1
            2
            3
            4
            5
            6
            7
            8
            9
            0
            -
            =
            Backspace
                                 
            Tab
            q
            w
            e
            r
            t
            y
            u
            i
            o
            p
            [
            ]
                                      
            Return
                                      
                                 
            capslock
            a
            s
            d
            f
            g
            h
            j
            k
            l
            ;
            '
            \
                                 
            shift
            `
            z
            x
            c
            v
            b
            n
            m
            ,
            .
            /
            shift
                                 
                                      
                                     English
                                           
                                           
            alt
            alt
                                 
                            
                           Preferences

                  

            • 3. Re: Creating a script to send PDF of record on iPad app
              TSGal

                   David Kinnaly:

                   Thank you for your posts.

                   Having colons in your file name may cause an issue.  Check to see if "Customer:::Last Name.pdf" is in fact created.  Perhaps you wanted the Customer::Last Name field concatenated with ".pdf".  If so, then change the first Set Variable command to:

                   Set Variable [ $FileName ; Value: Customer::Last Name & ".pdf" ]

                   Assuming the PDF file is created, open it and check the contents.  Is this what you were expecting.  If so, then change the second Set Variable command to:

                   Set Variable [ $PDFPath ; Value: "file:" & Get ( DocumentsPath ) & $FileName ]

                   Keep me updated with any progress.

                   TSGal
                   FileMaker, Inc.

              • 4. Re: Creating a script to send PDF of record on iPad app
                DavidKinally

                     TSGal it was in fact the naming issue. Changed it to what you recommended and BOOOM in the bag!!!!

                      

                     Thanks for your help

                                
                               Preferences
                §
                1
                2
                3
                4
                5
                6
                7
                8
                9
                0
                -
                =
                Backspace
                                     
                Tab
                q
                w
                e
                r
                t
                y
                u
                i
                o
                p
                [
                ]
                                          
                Return
                                          
                                     
                capslock
                a
                s
                d
                f
                g
                h
                j
                k
                l
                ;
                '
                \
                                     
                shift
                `
                z
                x
                c
                v
                b
                n
                m
                ,
                .
                /
                shift
                                     
                                          
                                         English
                                               
                                               
                alt
                alt
                                     
                                
                               Preferences