hartmut Posted February 20, 2008 Posted February 20, 2008 Hello I have a field called " startdate" I would like my database to automatically delete the record containing that date one year later. without any dialog. What is the best way to do this and not involve the end user. Kind of a hidden function. Thanks
Inky Phil Posted February 20, 2008 Posted February 20, 2008 Assuming that your solution gets shut down on a daily basis you could include a routine in your startup script that finds all records that are, to the day, one year old (or older to allow for weekends/leap years etc) and then delete the found set. HTH Phil
mr_vodka Posted February 20, 2008 Posted February 20, 2008 Just to add... If you have FMS 9 you can have a scripted schedule that does this.
Fitch Posted February 20, 2008 Posted February 20, 2008 FileMaker Server 9 can now schedule and run scripts directly (with certain limitations), so Phil's script could be run daily that way as well.
hartmut Posted February 20, 2008 Author Posted February 20, 2008 what would be the best way to wipe out a record. I would put it in a script that starts with the program. find all records with a certain date (today) and then delete found set? Thanks Dave
Fitch Posted February 21, 2008 Posted February 21, 2008 Something like this: Set Error capture (ON) Enter Find mode Set field(startdate ; "<" & Get( CurrentDate ) - 365 ) Perform Find If( Get( FoundCount ) > 0 ) Delete All Records( no dialog ) Else Show All Records End If
mr_vodka Posted February 21, 2008 Posted February 21, 2008 or if you always want it on the same day... Set field [ startdate ; "<" & Let ( d = Get ( CurrentDate ); Date ( Month (d) ; Day (d); Year(d) -1 ) ) ]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now