October 11, 201015 yr I am trying to create an on timer script thats sends an email on the date before a bill is due based of of the "Date Paid" being empty and the "Date Due" Field. I can not find a way for the to get it all to come together. The email part I can set up. Its getting the search done properly and the bills that are due in the message field of the message.
October 11, 201015 yr I don't see the need for an ontimer script. Just run a Send Reminders script each day ( or if using FMS, create a server script to run each night). I like to make fields that capture my logic and then find on that field. So, in this case, I would create an UNSTORED calc field "flag_ReminderDue:" flag_ReminderDue = isEmpty ( Date Paid) and isempty ( ReminderSent) and Date Due-1 <= get (currentdate) Now, Find on that field in Bills. Go to Related Records, match found set, up to Customers. Now you have the found set of Customers that need a reminder sent. Loop thru the found set, sending an email to each Customer. To include the info about the Bills due, use the List ( ) function to gather the child bill data. You can create a field in Bills that strings together the Bill data and use that field in the List function. (See Bruce's recent demo for this technique http://fmforums.com/forum/showpost.php?post/367782/) Part of the loop needs to populate the field in Bills "Reminder Sent" with today's date, otherwise you'll keep sending reminders until they've paid. You can add a column on your Customer List to show that they need a reminder (and/or use conditional formatting) to hilite their row.
Create an account or sign in to comment