1 Reply Latest reply on Mar 25, 2011 8:07 AM by philmodjunk

    Calendar Alert Setup

    KAmsinger

      Title

      Calendar Alert Setup

      Post

      I am in FMP Adv 10. I have a table which contains a drop-down calendar field which is setup in a portal that contains other text fields as well. I want to setup a script that that looks at the first portal row and checks the date in that portal row and 3 weeks after that date send me an alert email to notify me to contact that person. I want this new script to perform when the DB file is first opened, so it would be connected to my OpenFile Script. The table this portal/calendar is in is called PERSON and the table contains thousands of records (over 12,000)  people contact information.

      Does anyone know how to set this up?

        • 1. Re: Calendar Alert Setup
          philmodjunk

          I think you'll need another table where you'd log the scheduling and sending of your alert emails. Presumably the record and or it's data changes frequently so your start up script would appear to have two parts for this. Part 1 would check the data in the first related record and add a new record to the email schedule table if such an entry had not already been made. Part 2 would check the email schedule table for any records that were set up for sending an email 3 weeks previously that have not yet logged the sending of an email. You haven't indicated what information you want to put in the email, but you can either populate a field in the email schedule table with the text you want in the body of your email or you can just have the script enter the ID number or numbers of the relevant records that will then serve as the source of the data included in the info.

          Your email schedule table would need at least these fields

          EmailSendON (date field, date when email is to be sent)
          EmailSentOn (date field, date when email was actually sent)

          Then you'd add whatever additional data fields are needed to produce the email, a text field with the message for the email body and/or ID fields that link to records in your database needed to construct the email at the time it is sent.

          To compute the send on date, you'd use: Set Field [EmailSchedule::EmailSendON ; Get ( CurrentDate ) + 21 ] to enter a date 3 weeks in the future.