There will be a lot of different parts to that script. Which ones can you do now?
Here's one link on using a script to save a PDF that will get you started on some of this: Found Sets to PDF with unique file names
Well we just started using filemaker 13 recently, so this will be the first script I have had to do. I am currently researching correct syntax to use, the link you provided me with definitely gives me a good starting point.
Thanks for the quick reply.
Ok, so I have decided to forgo converting to .pdf and simply use the built in script steps to email data from some of the fields and allow them to look up the full record.
But the issue now is being able to include information from more than one field in the message of the email, I only see how to specify one field to pull data from.
Instead of selecting "Specify Field Name..." for the Message body, select "Specify Calculation..." this opens a calculation dialog where you can develop a more complex email body.
For example, I have a table of applicants. This calculation ""The Applicant's Name is " & tblApplicant::AppNamePrefix & " " & tblApplicant::AppNameFirst & " " & tblApplicant::AppNameLast & "." will produce the following text in the email body "The Applicant's name is Mr. John Smith."
The "&" character allows you to concatenate different fields and text strings together into one coherent thought. And the "¶" character (not used in my example) generates a line return to make new paragraphs.
Thank you both, I got it to look just the way I wanted.
Well ran into another issue, when I close filemaker pro it sends another email from a blank record. Is there a way to protect against this?
Simply closing the file will not send out any email of any kind.
Are you using a script trigger to send out this email? Which one?
I am using a button called submit to perform the script, I never actually set a script trigger. I need to add some kind of "if" statement to protect against closing filemaker sending the email out.
Send Mail[Send via SMTP Server; To: ""; Subject: Trainee Report::Record Number; Message: "The SubmittersName is " & Trainee Report::Submitter First Name & " " & Trainee Report::Submitter Last Name & " " & "the trainees name is" & " " &Trainee Report::Name of Trainee: & " " & "the description of the incident is," & " " &Trainee Report::Description of Incident; Name: "ryan"; Email Address: ""; SMTP Server: ""; Port:25; Authentication Type:None ][No dialog]
Show Custom Dialog[Message:"Record has been Submitted"
but the script steps shown do not close the file and closing the file will not perform this script.
So I don't follow what problem is occurring here...
The problem is, when I close the file it preforms the script. The script itself does not close the file, but when I close filemaker it preforms the script.
I need to create an if/else statement that will preform the script when the submit button I created is pressed, but protect against the script being preformed when the file is closed.
The only way that can happen is if there is a script trigger set up to perform this script, but you say that you have not setup any script triggers.
In File Options, the OnLastWindowClose and OnWindowClose triggers will be tripped when the file is closed.
In Layout setup, OnLayoutExit will be tripped when the file is closed.
On a field in the layout, OnObjectExit will be tripped when a file is closed if the cursor is in that field at the time the file is closed. OnObjectSave and OnObjectValidate might also be tripped if data in the field has been changed.
The only explanation that makes sense is that at least one of those script triggers is set up to either perform the script you've posted or they perform some other script with a perform script step that performs the script shown.
But none of this is something that "just happens". Someone has to make a specific design change to your database in order for this to take place when you close the file.
Thanks for the help! It turns out that having two people work on one database is not a good idea...
The had set a script trigger for OnWindowClose for a different script.
Thanks again for all the help.
I'm working on a similar project for a client, and I was wondering if you'd be willing to share your script to send an email when a new record is added. I'm a new developer, and I'm looking for examples to start working with.