Skip 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.

delete records longer than 2 days automatically

Featured Replies

Is there a way in the data calculation that would delete a record if it was more than 2 days old. If so could someone please write me up a sample. (Hopefully it will be a easy one.)

Thank you in advance

Are you sure you want to delete records? Will you *never* want to report on historical data?

Better to add a number field (call it "obsolete"). This type of field is called a "flag" field which contains a 1 if the record is to be considered obsolete.

Create a script named "Open":

Go to Layout (YourLayout)

Enter Find Mode()

Set Field[YourDateField; "<" & Get(CurrentDate) - 2]

Perform Find[]

Replace Field Contents[No dialog; obsolete; 1]

Show Omitted

Choose File Options... from the File menu.

Check the Perform Script checkbox and select Open.

This will run the script when the file is opened, and set the obsolete flag to 1 for records older than 2 days, and then show only the ones which are not obsolete.

  • Author

Yes, I am sure I do not need any historical data on this. A script like this one will not be needed because I can always do a search base on the date that it was created and then delete those found records. I usually do this every two days but this is becoming cumbersome.

Are you sure you want to delete records? Will you *never* want to report on historical data?

Better to add a number field (call it "obsolete"). This type of field is called a "flag" field which contains a 1 if the record is to be considered obsolete.

Create a script named "Open":

Go to Layout (YourLayout)

Enter Find Mode()

Set Field[YourDateField; "<" & Get(CurrentDate) - 2]

Perform Find[]

Replace Field Contents[No dialog; obsolete; 1]

Show Omitted

Choose File Options... from the File menu.

Check the Perform Script checkbox and select Open.

This will run the script when the file is opened, and set the obsolete flag to 1 for records older than 2 days, and then show only the ones which are not obsolete.

Whether or not it's a good idea to delete records, why would you want to? You can always write a script that runs when the file opens tht shows you the records you need to see.

RW

Well, if you're sure:


Go to Layout (YourLayout)

Enter Find Mode()

Set Field[YourDateField; "<" & Get(CurrentDate) - 2]

Perform Find[]

Delete All Records[No Dialog]

Show All Records

The Delete All Records step deletes only the found set.

You can attach the script to a button or run it on startup.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.