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.

Find Empty files and Delete them

Featured Replies

  • Newbies

Hello,

I'd like to add a functionality to my file where with a click of a button that is on that file, FM will check if there is any empty records in that file and automatically delete them from a file.

What is the best way to do it? I tried using basic scripts, but there is nothing there.

Thanks

Depends on what constitutes an empty record. Do all the fields need to be empty or just key ones?

You could create a calculation field that looks like this:

IsEmpty(field1) and IsEmpty(field2) and IsEmpty(field3)...

If all the important fields are empty, the calculation will return a value of 1. You could then create a script that searches for all the records whose calculation field returns a 1 and deletes the found set. You'll probably want to check to see if the find returns any records. If it doesn't, you'll want to exit the script, otherwise you may delete records you want to keep.

Hi montenegro,

IMHO, it would be better to deal with the cause instead of the effect. You can control the adding of blank records by taking some preventive steps in your design. I would do the find and deleting by hand.

As you might suspect, this topic comes up quite frequently. A search of the Forums using Duplicate Records should produce several threads, including one that was active in the last day or so.

HTH

Lee

wink.gif

Hi John,

With you on the board, it looks like I'll have to stop taking phone calls when answering posts.

grin.gif

I second what Lee is suggesting. A good solution for making sure records aren't created inadvertently is to script the process.

You'd have a button called New Record (or something like that).

This would take you to a layout that was a duplicate of your regular layout but was populated with global fields that mirrored all the regular fields. It would be the global fields into which your user would enter data. On this global field layout, you'd have a Save and a Cancel button. Clicking the Save button would execute a New Record/Request script (you could even put in a "Are you sure" type of confirmation message before the new record is created if necessary) and then a series of Set Field script steps would set the contents of your regular fields with the contents of their global counterparts. You'd then clear the globals and return to the regular layout. The cancel button would just clear the globals and return to the regular layout.

(Hint - since the last steps the Save script are the same as the Cancel script, you could just call the Cancel script where you would normally have to duplicate the script steps.)

Are you on the phone with Arnold, making sure he doesn't screw up as Governor?

wink.gif

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.