Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2003

    Unanswered: Help with script


    I need to write a script that finds all records that are older than 48 hours with a field that is set to 'open' and delete them.

    Can any one point me in the right direction.


  2. #2
    Join Date
    Jul 2003
    Several ways to do this. One fast way would be to:

    1 Create a field such as "created_date" and "created_time"

    2 In the options for those fields, have the date/time autoentered at creation.

    3 create third field called age.

    4 create a script that 1) shows all records 2) replaces the contents of Age with a calculated value - Use "Today" and status(currenttime) against careated_date and Created_time to work out the age of the record. As a suggestion, have your script calculate it down to total minutes or something like that.

    5. run the script.

    6. perform a find in age for >XXX minutes where XXX minutes are the expiry time you need (i.e. 48*60=4880)

    7. Now create another script that performs a find, restoring the find request you just did.

    8. If you like you can either include the replace script as the first step in your find script (so that it automatically updates the age of the record before the find.) or dream up some other way.

    Finally, if you need to automate this on a given frequency, I might suggest Troi-Activator as a plugin that works well for scheduling scripts. Oazium Events is also very good.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts