skynight Posted November 24, 2006 Share Posted November 24, 2006 I realise I know very little about FM. I am trying without success to develop an email function. I have a field that calculates the days "overdue" following a "due date" that is entered for something to happen. The field looks at today's date and shows a negative number if there is still time to go and a positive number if it is overdue. I want the program to email me when there is, say, 10 days remaining before the due date if the action has not been completed. I understand how to save a copy of the record in PDF and then to tell it to email that record, but how do I initiate it? Can it send the file and the email without the program being opened and running? If the critical time for sending the email is on a weekend and I am not in the office to open the program, how would it happen? Would someone please look at the script I tried (it did not work) and let me know where I am going wrong please, and help me to set up the necessary commands to make it so? Thanks.. If[Days Overdue -10] Save records as PDF[Restore; no dialog; "Due.pdf";Automatically open;create email;Current record] Send Mail[No dialog; to:"[email protected]"; subject:"Watch out";Message:"Warned you"; "Due.pdf"] End if Link to comment Share on other sites More sharing options...
petererik Posted November 24, 2006 Share Posted November 24, 2006 Hi, Are you using FMP8? If so, this worked for me: If[Days Overdue -10] Save records as PDF[Restore; no dialog; "Due.pdf";Automatically open;Current record] Send Mail[No dialog; to:"[email protected]"; subject:"Watch out";Message:"Warned you"; "Due.pdf"] End if I removed the "create e-mail" option in "Save records as PDF". I do however get a security warning "A program is trying to automatically send an e-mail on your behalf", which requires a user prompt (there are third party add-ins that can turn this off, just Google the warning message and you will find them). If you want this script to run 24/7 then your FMP will have to run 24/7 as well. You could create a loop, but the most reliable way to fire a script for me turned out to be to use a third party tool of which there are a few. I personally use Dacons Scriptfire. Peter Link to comment Share on other sites More sharing options...
skynight Posted November 29, 2006 Author Share Posted November 29, 2006 Thanks for the help, it is appreciated. What do I do with this script (it is a script?). How do I associate it with the field and make it run? Do I make it a calculation field? Or will the script just run if I store it in the scripts list? Pardon me for my iggerence, I tell people there is no such thing as a stupid question but maybe this disproves that statement! Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6142 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now