5 Replies Latest reply on Apr 30, 2012 1:05 PM by RPaulH

    Need advice on timed events

    RPaulH

      Have various places in our DB where a change made to the "Status" field should start a timer that will initiate something else after a specific interval (eg: After 24hrs send an email if certain criteria are not met, or after 14 days if we are still waiting for an invoice email the vendor). Hope that makes sense. These status changes will happen multiple time per day from different layouts and each is separate from the others. Does each one need an install ontimer script step, or something else running on the server? Running FMSA11 and FMP11 on all systems. Just need some ideas that I might not have thought of.

      Thanks,

      Paul

        • 1. Re: Need advice on timed events
          BruceHerbach

          Paul,

           

          In you case,  I would consider setting up a sperate table for times events.  Items that don't occur for 24 hours ( or so ) would be lost when the user closes out the database.

           

          In the table,  I would have what should happen, for whom it should happen,  a complete flag ( or open flag) and any other key information.

           

          Add a few steps to a file open script that opens a window off screen. and sets an ontimer script to run every x minutes and check the table.  If an items is due,  do it.

           

          You will also need a close script/button that will close the off screen window.

           

          HTH

          Bruce

          • 2. Re: Need advice on timed events
            digital-carpentry

            Running a timer for 24 hours in the background doesn't seem like the best way to go on this.  How time sensitive are these "timers"  do they need to be down to the minute?  or more general?

             

            Consider setting a timestamp when the status is changed, then calculate based on that timestamp a flag that will trip when the time is up if the criteria are not met.

             

            You can run a simple find script to act on tripped flags daily hourly, or however often you need to move on them.

            • 3. Re: Need advice on timed events
              Mike_Mitchell

              Piggybacking on the previous suggestions, you could set up a server-side batch job that goes in and finds all the flagged records and takes whatever action necessary. That way, no user needs to be in the database and you don't have to worry about opening any OnTimer windows to make your maintenance happen.

               

              Mike

              • 4. Re: Need advice on timed events
                digital-carpentry

                Yes if this is hosted definately schedule the scripts, if not, it could be triggered in opening script but that may not be frequently enough so go with Bruce's suggestion to use the opening script to push a looping script to call it up every x amount of time.

                • 5. Re: Need advice on timed events
                  RPaulH

                  Thanks to all who contributed above. Already mapping out the different timestamp fields and flags for each "duration". I was definitely overthinking it before. Will post back with any issues, but do not anticipate such.

                  Take care,

                  Paul