duncs Posted March 20, 2008 Posted March 20, 2008 Hi! I have a real estate database that records all visits to a poperty in a portal. There are fields for date and agent name among others. I would like to create a script that automatically generates an email (from an external email program, in this case mail.app) with the agents name in the to: field and a stock comment like "how did the showing go" in the subject and email. The script should be triggered 24 hours after the date of the showing. Any help would be appreciated!
duncs Posted March 20, 2008 Author Posted March 20, 2008 Oh, I should add that I know how to create the email with a script, my problem is working out the "trigger" to cause the email script to be performed. Thanks for your time!
MelJ Posted March 21, 2008 Posted March 21, 2008 (edited) I use a Plug-In for this type of thing..Troi Activator. http://www.troi.com It has MANY other uses you might find valuable. Edited March 21, 2008 by Guest
duncs Posted March 21, 2008 Author Posted March 21, 2008 Thanks MelJ, I'll look into that, but at the moment I would rather try to make it work with a script, I think I am stumbling over an if statement (I'm a novice!!) I have created a yes/no field to confirm wether an email has been sent. Basically I need a script that says: If the showing date is earlier than the current date, and the email confirmation field is set to no, then run the send email script, if not move to the next showing and repeat. I have created the "send email script" and that works, it's the trigger that isn't. This seems pretty straightforward, but I think I am getting stuck with the syntax of it all. Any ideas? Thanks
MelJ Posted March 21, 2008 Posted March 21, 2008 I'm no expert by any stretch but as far as I know FileMaker cannot run scheduled tasks. The script should be triggered 24 hours after the date of the showing. If you are running server, it will run scheduled tasks but only from the server not from a client.
bcooney Posted March 21, 2008 Posted March 21, 2008 I'd put the calling of your script in the Open Script. So, on login, the system would go to the Visits table and find all visits where the flag_NeedEmail is equal to 1. The flag_NeedEmail = if (emailsent="No" and date_visit < get (currentdate)). This is an unstored calc, so finding on it will be a bit slow. You could find on emailsent="No" and then Constrain found set on flag_NeedEmail. By the way, why not store emailSent_date rather than a Yes / No?
duncs Posted April 14, 2008 Author Posted April 14, 2008 Thanks for the info, and apologies for my delay in sending that thanks! I shall give the above a go and see if I can get it to work. I was thinking along the lines of a "log on" script, but shall have to see how much that slows down the start up.
Recommended Posts
This topic is 6068 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