If the database were hosted from server, a server schedule could be used to do this.
But setting up a script to run when the file is first opened is also possible. I suggest that you set up a "log" table where an entry is made each time the sript finds and deletes records. The script can check the most recent record in this table to determine if any records need to be deleted and what date criteria to use when searching for records to delete.
Thanks for the quick reply.. I have to run the script on the File side... But which Parameters/function would you use to check for the date?
I already have a Timecreated and TimeModified Fields on each record..
Can you put a sample of what you might do? Keeping in mind finding only records from Monday-Sunday of the current week..
For scripted finds that use date criteria, see this thread of scripted find examples: Scripted Find Examples
Your script can create a new record and log the date criteria used each time that it deletes records. The same script can then check this data to determine, for example, that the records were deleted yesterday and there's thus no need to do anything today...
Thanks for the advice.. this is what I came up with.... thoughts..??
-This way I can keep records on there from Sunday-Saturday.. (criteria changed.. LOL)
You might also use:
Set Variable [$DeleteDate ; //see calc on next line:
Let ( today = Get ( CurrentDate ) ; Today - Choose ( DayOfWeek ( today ) ; "" ; 1 ; 2 ; 3 ; 4 ;// and so forth ]
And I recommend not using variables inside stored find criteria. It will work just fine, but you have to double click the script step to see how the variables are used in the find.
If you use this type of scripted find:
Enter Find Mode  --> clear the pause check box
where the set field steps specify the find criteria, you can see the criteria used to perform the find without having to open that extra dialog to see the details.