Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script to delete a record?

Featured Replies

Hi, I have yet to try and write a script. Can this be done? I want to have my DB clear old data automatically? One time perday, say at 9:00am, I want the script to search all the records and check for any dates that are 1 day past the current date and when found either delete them and/or save them to a new DB. I will have a date field that has end of life of the record. So if today's date is Jan 9th, the script will look for records dated Jan 8th, and when found will either delete them and/or save them to a new DB. I use FMPro 4.0 but may be getting 5.0 soon. Thanks for your help, Wayne

A script to find records based on date/time information is fairly easy. Problem is, FileMaker scripts can't be set up to run automatically at a particular time; not without a plug-in anyway (I've used Oazium Events -- I think that's how it's spelled -- before and it worked pretty well).

Anyway, you can have your script go into find mode, set your "lastdate" field to something like "<" & datetotext(status(currentdate)) and do a find. Then you can export or delete the set.

Jeff

  • Author

Thanks Jeff, I Have seen ads for that company in FMPro magaazine and will look in to it. Wayne

If this should be an automated task, why not put it together (if you already have one) to the script you run when opening the file.

If Today

Perform script

End If

Perform other script

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.