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.

How to clear all fields with a script

Featured Replies

Hi All,

What I'm trying to accomplish is a script, that when run will clear certain fields in that record. I have cost, quantity and total fields that I want to be able to have the user clear, without deleting the contens of each field individually. I tried this:

Loop

Goto field (field1)

Clear

Goto next field

Clear

If getfield (total cost)

End If

End Loop

Beep

But, of course, it doesn't work.

Any help would be greatly appreciated.

Thanks in advance,

Don

Dmacman

[ September 07, 2001: Message edited by: Dmacman ]

You can clear any field except a date field with the following:

SetField(quantity,"")

On date fields use the following: SetField(MyDate,TextToDate(""))

I don’t know if this will help you…. But one of the most effective ways of deleting lots of fields in one record is as follows:

Lets say you have 20 fields in a record and you want 15 of them deleted.

Create a self-relationship based on an individual ID for each record.

Set the 5 fields you don’t want to delete to lookups based on the above relationship.

Create a script that:

Omits the record you want to edit

Finds omitted – i.e. only the record you want to edit

Creates a new record

Sets the ID field in the new record to the ID of the original record

(Performs the lookups on the 5 fields)

Then deletes the original record

Believe me, this idea sounds crazy, but in some situations it’s a lot better than using loops etc. to set fields to 0 values. Anyone who doesn’t believe this should give it a go:

Set up a record with 20 or 30 fields where most of them should be set to 0 values. Then use the set field command to set from 30 25 fields to “” or 0. After this, try the method above – you’ll see that it’s about 50 times faster.

Rigsby

Create an account or sign in to comment

Important Information

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

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.