Add e-mail to form and use to e-mail current record

noad
noad used Ask the Experts™
on

 I need to be able to create an e-mail filed on the form, then create a button that when I click on it, it will pick the current form and e-mail it. I like to be able to get the e-mail from the e-mail filed or be able to modify it on the fly.

Thanks...
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Will LovingPresident, Dedication Technologies, Inc.

Commented:
Are you wanting to email the contents of the form as text or as a PDF?

Author

Commented:
PDF plz...
President, Dedication Technologies, Inc.
Commented:
So, what you need to do is create a multiple step script using FileMaker's Scriptmaker - a script being a programmed set of steps that occur in sequence and can be triggered from a button or by other means within FileMaker. Creating scripts is something that can take a long time to become proficient at, and can be easy or difficult depending on what you are trying to do. This is an intermediate level script that requires me to explain a couple of concepts, so hold on; you may need to experiment. The script does the following:

1) sets the location and name for the PDF
2) Save the PDF to the location specified
3) Create and send an email with the PDF as an attachment

FileMaker also has two email sending options: 1) putting the email in the outbox of the local email client (Outlook, Entourage, Eudora, Thunderbird, etc. ) on the local computer or 2) using SMTP settings. I'll assume for simplicities sake that you are doing the first option.

In order to save a layout as a PDF which can then be attached to an email, you have to specify a place to save it temporarily before you send the email. The simplest way to do this is to define a variable with the path to the Temp folder on your hard drive. The Temp folder is in a known location and since it gets regularly flushed you don't have to worry about deleting the PDF later. So the first step in the script is a "Set Variable" step to create a variable called $PDF_Path. (I'm listing the steps as the will appear on the right-hand column of the Scriptmaker Window.)

   File Name and Temp Folder Path
I won't go into details here, but this calculation sets the path and name for the PDF file to the Temporary Items folder. I've named the file "My Report Name.pdf", but you can substitute your own name for the "My Report Name" part or use a field or combination of fields to name the file.

Step 2 is to actually Save the PDF using the "Save Records as PDF []" function. Under the "Specify Output file" option for this script step enter the variable created in the first step $PDF_Path. Under "Specify Options" change the "Save option" to "Current record", and tick the Perform without dialog checkbox.

 Save as PDF
Step 3 is the use the Send Mail script step to send the email with PDF attachment. In the "Send Mail" Options dialog, you will need to enter a number of values including the Email address, Subject, Message and the path to the PDF file to be attached. In each of these areas you can either type in text, for example if the Email address or subject line is always the same, OR, you can reference a field, such as the field containing the email to send to. To attach the PDF file, click "Attach file" and "Specify" and enter $PDF_Path, the variable you defined at the outset that contains the name and location of the PDF file.

 Send Mail Options
When you are done your script should look something like this:


 Send PDF script
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Author

Commented:
I'll try this tomorrow....

I need your help with something more pressing

I created a DB, and in it a print layout alone with a print button... it works when I use it from the PC and it will print with I use it on and iPad, but it will not print the fields like the date and user name ect.. when it prints from the iPad.

Any idea as to how I can fix this?

I will create a post, if you would plz help!!!
Thanks
Will LovingPresident, Dedication Technologies, Inc.

Commented:
I unfortunately don't have an iPad to test with, and yes, it would be a separate question that perhaps someone else can answer.

Author

Commented:
I did post it

As for the email button

1- create the email file
2- crate button n to button add the script?

Will LovingPresident, Dedication Technologies, Inc.

Commented:
Sorry - I don't follow you...what are you asking?

Author

Commented:
The instruction you gave me

What would be my start point?
Will LovingPresident, Dedication Technologies, Inc.

Commented:
Open your file, go the the Scripts menu, select Scriptmaker, create a new "empty" script, give it a name and then add the steps I listed.

Author

Commented:
OK,
Thanks...

question, do you teach?
Will LovingPresident, Dedication Technologies, Inc.

Commented:
You mean do I teach FileMaker or do I have a background in teaching? I did used to teach FileMaker (as well as QuarkXPress and Pagemaker years ago) and I also taught school for 4 years, worked for Outward Bound, taught swing and contra dance, and quite a few other things.

Author

Commented:

 Just meant, FM Pro, if you teach it..
If your interested, in teaching on a hourly base... we can use a remote tool and you can answer any question I have and show me how to do it,,,,
I would pay.
Will LovingPresident, Dedication Technologies, Inc.

Commented:
Click on my profile and use the "Hire Me" link so we aren't doing this within the question framework.

Author

Commented:
I will try this tomorrow if I have time while at the F.D.
Again
THANK YOU VERY MUCH!!!

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Author

Commented:
PLease give WIllmcn the point I work fire rescue and just got busy, but his explanation is correct.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial