1 2 3 Previous Next 33 Replies Latest reply on Jun 11, 2012 6:00 AM by nella

    Sending email with attachment

    nella

      Hi folks,

      I'm trying to send my purchase order using foriegn key field ::Email_suppliers.

      It opens Outlook and has the attachment etc but does not have the supplier's address in the address bar.

      Can someone help me with this?

      Image3.jpg

      Here is the script that I have been trying use.

      Image2.jpg

      Thank you.

        • 1. Re: Sending email with attachment
          nella

          I'm sorry, not foriegn key field but a related field.

          • 2. Re: Sending email with attachment
            ariley

            Email_suppliers is a regular email field, right? You mention "foreign key". That just means the ID of a related item in the current table.

             

            I'm assuming there is something in the email field.

             

            Also, when you're sending the email, you are on the right layout, right?

             

            What you can do is set the email from that field to a variable and see in a custom dialog if indeed it gets picked up (while you're debugging), then if indeed it is showing then something happens in Outlook.

             

            Regards,

             

            Agnes Riley

            FileMaker 10 and 11 Certified Developer

             

            http://www.zerobluetech.com

            C 917 660-7221

            T 201-293-5828

             

            Member, FileMaker Business Alliance

            Member, FileMaker Technical Network

            • 3. Re: Sending email with attachment
              nella

              Hi Agnes,

              Newbie alert!

              I'm sorry, not foriegn key field but a related field.

              Regular email field? I'm not sure what that means but yes there is an email address in the field.

              ::Email_supplier is in my Purchase Order table and is related to Email_suppliers in the Suppliers table.

              I created a button called Email P.O. and used the above script to send the attachment email from ::Email_supplier.

              • 4. Re: Sending email with attachment
                nella

                This is what is showing in my Outlook address bar.

                email.jpg

                • 5. Re: Sending email with attachment
                  pthomas

                  Hi nella,

                   

                  From the screenshot in your first post it looks like your script is running from a layout based on your "Line Items" table, and you are trying to use a field from your "Purchase Orders" table to populate the e-mail address.

                   

                  My first thought would be to check that you have a relationship between those two tables?

                   

                  If you put the "Purchase Orders::Email_supplier" field onto your "Purchase Order (Line Items)" layout do you see any data?

                   

                  Cheers,

                   

                  Paul.

                  • 7. Re: Sending email with attachment
                    pthomas

                    Ok I would try changing your script to use a variable for the e-mail address as suggested by Agnes.

                    So add a line:

                     

                    Set Variable[$To; Value:Purchase Orders::Email_supplier] - keep an eye on the value of the variable, if FileMaker can not find the field you have defined it will throw some quotes around the value and turn it into a string of text and you will end up with:

                     

                    Set Variable[$To; Value:"Purchase Orders::Email_supplier"]

                     

                    This indicates that the either the table occurance name or the field name are incorrect.

                     

                    Assuming the variable is set up properly you then need to change your Send Mail step to use the $To variable in the To field.

                     

                    That way at least you can step through the debugger and see what value the variable is getting set to.

                     

                    If you can't run the debugger, put in a "Show Custom Dialogue" step after the variable decleration and set either the Title or the Message of the dialogue to the $To variable so you can see what value it is getting set to.

                     

                    Cheers,

                     

                    Paul.

                    • 8. Re: Sending email with attachment
                      nella

                      Paul,

                      This is what I get in the Outlook address bar:

                      Purchase Orders::Email_supplier

                      • 9. Re: Sending email with attachment
                        pthomas

                        Can you please post an updated screenshot of your script?

                         

                        Also a screenshot showing the actual relationship between Line Items and Purchase Orders would be helpful (double click on the white box on the relationship line and take a screenshot of the dialogue that comes up!).

                         

                        Cheers,

                         

                        Paul.

                        • 11. Re: Sending email with attachment
                          pthomas

                          Ok I can spot a couple of problems with your script.

                           

                          You need to change the value of the $To variable to Purchase Orders::Email_supplier (currently it is being set to Purchase Orders::Supplier_Company).

                           

                          Also you need to update your Send Mail step, it is still configured to send to Purchase Orders::Email_Supplier.

                           

                          Your Send Mail dialogue should end up looking something like this:

                           

                          Capture.PNG

                           

                          Cheers,

                           

                          Paul.

                          • 12. Re: Sending email with attachment
                            ariley

                            Nella,

                             

                            Sorry, I was out all day.

                             

                            I am too tired to look at your script again, but I think that if you're getting 

                            Purchase Orders::Email_supplier

                             

                            In your address field in Outlook, then you need to wrap the data in the to field in the Evaluate function:

                             

                            Evaluate (

                            Purchase Orders::Email_supplier

                             

                            )

                             

                            I can take a longer look tomorrow or help you via a quick screen share.

                             

                            Cheers,

                            Agi

                             

                            agnes b. riley . filemaker and web development

                            www.zerobluetech.com

                            T 201-299-6223 (NJ) . 212-842-8830 (NY) . 917-660-7221 (C)

                            FileMaker Certified in 10 and 11

                            • 13. Re: Sending email with attachment
                              nella

                              Paul,

                              Now the Outlook address bar is empty. (No email address)

                              Here is what I have in the send mail:

                              email.jpg

                              • 14. Re: Sending email with attachment
                                pthomas

                                I have just had another quick look at the send mail script step on my computer, and looking at the screenshot of your script again I may have spotted the problem.

                                 

                                It looks like you have quotes in your send mail To: field.

                                 

                                So instead of having:

                                Capture.PNG

                                You have:

                                Capture.PNG

                                Try removing the quotes!

                                 

                                Cheers,

                                 

                                Paul.

                                1 2 3 Previous Next