13 Replies Latest reply on Aug 7, 2015 6:12 AM by philmodjunk

    Send Mail script

    ChrisHicks

      Title

      Send Mail script

      Post

      I am creating a "Fill In The Blanks" form in Filemaker Pro Advanced 13.  I have the fields all set.  Once the agent fills in the fields, I want him to be able to click on the submit button that I added and have the data that he entered be emailed to me and to my assistant.  I added the send email script and it opens the apple mail with my name, assistant name and subject, but it does not have the data.  How do I include the data in the email?

      Sorry if that is a newb question.

      Chris

        • 1. Re: Send Mail script
          philmodjunk

          You would either set up a calculation in the email body that references all the fields (the blanks) that the user filled in (Click the black arrow button to the right of the body section) or you would first save a PDF of that layout and attach it to the email as an attachment.

          • 2. Re: Send Mail script
            ChrisHicks

            Phil,

            I know how to create the button to send it by email and I know how to set up the recipients of the email.

            I don't know the calculation side of script writting, I am a novice when it comes to working on FM.  I am attaching a picture of the info.

            • 3. Re: Send Mail script
              philmodjunk

              The PDF option can be done fairly easily without scripting or it can also be scripted.

              The calculation option requires a script.

              There's a send mail script step. you can add it to your script in Manage | Scripts and then Open up this dialog and enter a  calculation such as:

              "Your Name: " & Untitled::Your Name & ¶ &
              "Type of Claim: " & Untitled::Type of Claim & ¶ &
              "Client Name: " & Untitled:Client Name & ¶ &

              And forth....

              The ¶ puts a carriage return in place after that line of text so that the next data appears on the next line.

              • 4. Re: Send Mail script
                ChrisHicks

                tried and I keep getting pop ups

                 

                 

                • 5. Re: Send Mail script
                  ChrisHicks
                  /files/4060c7fea0/Screen_Shot_2015-08-06_at_11.25.23_AM.png 619x495
                  • 6. Re: Send Mail script
                    philmodjunk

                    Keep in mind that I am specifying multiple rows of expressions that make up a single calculation so I don't quote get the point to the second screen shot.

                    & is an operator that "glues together" the values found before and after it so you can't make it the first nor the last character in the expression.

                    The first row of the calculation is:

                    "Your Name: " & Untitled::Your Name & ¶ &

                    You then add the second line to get
                    "Your Name: " & Untitled::Your Name & ¶ &
                    "Type of Claim: " & Untitled::Type of Claim & ¶ &

                    all in the SAME calculation dialog.

                    You repeat this pattern until you get to the last line where you enter:

                    "Phone: " & Untitled::Phone

                    Note that there is no ¶ or & after this last field.

                    (Think of it this way, if you were adding numbers, + 5 + 6 would not be correct, 5 + 6 + would not be correct. 5 + 6 would be correct.)

                    • 7. Re: Send Mail script
                      ChrisHicks

                      Tried doing what you said and now I get a different error

                       

                       

                      • 8. Re: Send Mail script
                        philmodjunk

                        You still have & ¶ & after what appears to be the last row of your calculation even though my example in the preceding post showed that you are not to do that.

                        But notice the highlighted colon in the above screen shot. This is the source of the error. The quotes immediately to the left are a typo and should be removed.

                        • 9. Re: Send Mail script
                          ChrisHicks

                          I really am sorry for not understanding all of this (I was a Music Education major so all my tech was self taught).

                          I fixed the two items you listed and not I am getting this error (I will owe you a six pack after this)

                           

                           

                          • 10. Re: Send Mail script
                            philmodjunk

                            You've got a bad field name. You named the field "Open or Reopen" and you should have gotten a warning message telling you that this was not a good field name. When you use it in a calculation. It is interpreted as a field named "open" followed by the OR logical operator followed by a field named Reopen. But you don't have any field named "open" and you get this error message.

                            You can rename your field and use the modified field name or you can select the entire reference: Untitled::Open or Reopen text and double click the field name in the upper list of fields. This will insert the reference but enclose in curly brackets preceded by a $ to keep it from being interpreted as I previously explained.

                            Other hints that may help:

                            "Untitled" is a terrible name for a table. Rename it to something more descriptive and it will really help as you develop your database.

                            The field names on your layout are just text objects. You can click the text tool (T) and then click one of them to edit them to be anything that you want. So you can name a field like this "OpenOrReopen" or "Open_Or_Reopen" to avoid this calculation problem and just edit the layout text to remove the underscores or insert spaces to make it read right on your layout.

                            • 11. Re: Send Mail script
                              ChrisHicks

                              Tried renaming it, but now it says the field cannot be found.  Tried the Open_or_Reopen thing and I got a pop up on that one as well.

                              I renamed the file, thanks for the pointer

                              • 12. Re: Send Mail script
                                philmodjunk

                                Why didn't you rename it using one of the examples I used?

                                What you renamed it to has the same problem as the original. Didn't you get a warning message to that effect when your renamed it?

                                Firsttime or Reopen

                                still has that "or" as a separate word in the field name and thus you still have this problem.

                                And did you try the other solution to this issue that I suggested? Where you delete this field reference and then add it back by double clicking the field name in the upper list?

                                The safest, quickest way to add field names to a calculation is to double click the field name in the upper list. This ensures correct spelling and in cases like this field name, correct syntax for the field reference.

                                • 13. Re: Send Mail script
                                  philmodjunk

                                  And I just noticed that the window in the background shows that you DID NOT rename the field as the field still shows there with the original field name. To rename a field, you have to open Manage | Database | Fields, find the field's definition and rename it there. you can't just use a new name inside the calculation.