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.

Erase all data in a record except one field?

Featured Replies

Can anyone help me create a script that would accomplish this? I want to strip all data out of a record except for one field. Is this do-able?

Thanks

You will have to play with it, but FileMaker does have a Design Function name Field Names ( FieldNames ( dbname , layoutname ) )

If you can pull it off, by doing a Set Field into a Global/Useless field, then you could blank out every entry except the one you want to save.

Other option is to create a new record & carry over the one value you have.

There is no easy way to do this that I'm aware of. But, it is doable. How many fields are in the table you are working with?

If it's not too many, lay out all of the fields (except for calculated and summary types) on a separate layout EXCEPT for the one you want to keep. Create a new (text) field named NameTemp (not needed on this layout). Then run a script that looks like this -

Freeze Window

Go to Next Field

Select All

Cut [select]

Set Field ["NameTemp", "Status( CurrentFieldName)"]

Loop

Go to Next Field

Exit Loop If ["Status( CurrentFieldName) = NameTemp"]

Clear [select]

End Loop

Basically, what this script does is goes to the first field on the layout (in order of the tab order), sets the fieldname of the first field to "NameTemp" and clears the contents of said field. Then it loops through all of the other fields and clears them as well. When it gets back to the "first" field, it stops. So make sure the same field is not shown twice on the layout, or at least make sure the duplicate isn't in the tab order.

  • Author

Aha! OK, I figured it out. Thanks guys! I tried what you said Bret, but it didn't seem to work, I probably missed a step somewhere. But I just made a script in the master file to go to the current record, then perform an external script in the database i wanted the cleared fields. In that script I just used the Clear script on all the fields I wanted to clear, and then minimize window. Works perfect! Thanks again!

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.