4 Replies Latest reply on Jul 23, 2012 9:00 AM by philmodjunk

    DATE TRIGGERED SCRIPTS: FINDING A DATE BEFORE OR AFTER TODAY

    GaryMak

      Title

      DATE TRIGGERED SCRIPTS: FINDING A DATE BEFORE OR AFTER TODAY

      Post

      I have the following Script in my database "ACCOUNTS":

      Show All Records
      Perform Find [Restore] (finds a particular company name)
      Perform Find [Restore] (ACCOUNT RECORDS::Expiration Date: [<=//] ) (This finds within the above company name, all accounts with an expiration date less than or equal today)
      Go to Field [ACCOUNT RECORDS::Expiration Date <= Get (Current Date)]
      Send mail (Send via SMTP Server; No Dialog; To:"me@mine.com"; Subject: "Hi, You're Expired"
      Go To Record/Request/Page [Next; Exit after last]
      End If

      This results in a search for any expiration date which is today or after today triggering and sending an email "Hi, You're Expired" to my account. No problem.

      The problem is how to write a script the will trigger an email ("Hi, You're Going to Expire Soon") that will trigger 60 days BEFORE the Expiration Date. That would have to calculate the expiration date minus today's date and if 60 days or less generate the email. However, the range must be limited to 1-60, because more than 60 would trigger emails from all records and 0 or less would compete with the above program which deals with the already-expired.

      I cannot figure out how to add/subtract time in Filemaker…

      Suggestions? Help?

      THANKS!