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.

Clear ALL Fields at once

Featured Replies

Hello, I have a layout with many fields and I was wondering if there was a command in the scriptmaker that would clear them all at once, instead of having to choose clear in the scriptmaker for each individual field...

Thanks for any help!!

Hi Lindsay,

Unfortunately, you will have to clear out each field individually.

Yes, there is a simple manner...

Go to field(FirstFieldOfYourLayout)

set field (aGlobalOne; Get(ActiveFieldName)

Loop

clear

go to next field

exit loop if(Get(ActiveFieldName) = aGlobalOne)

End Loop

Hi Lindsay,

But why clear all fields? Why not create a new record? Clearing all fields to re-enter data means that the record won't reflect the correct 'date created' nor correct Creator name (if you use those auto-enter features). Can you explain a bit more of your process? :wink2:

LaRetta

  • Author

Hello all, thank you for your help! I did not want to create a new record everytime because the way I understand it, (or atleast have it set up) when I create a new record, it saves it, and I start building a database of records. The information I am inputting into this particular layout only needs to be printed once and then can be deleted forever. No need to keep a record of it! ( also, I don't use either of those auto features!) Is there a way to create a new record without it automatically saving the old ones? Thanks for your help!

Go ahead and create the records in a table when you are done on exit just delete all records of that table.

..... The information I am inputting into this particular layout only needs to be printed once and then can be deleted forever. .....

Interesting approach. Is this data that you are only keeping for a print, being imported as part of other data that is being kept?

If not, and it isn't needed for any other purpose, why are you putting it in there in the first place?

Lee

Edited by Guest

Despite a record containing an exorbitant number of fields to clear, points in direction of a lesser normalized datastructure, could you however make one single field trigger for the rests behavior. What if all relevant field gets following autoenter (replaces...) attached to thier defs.:

Evaluate(Case(0;0);triggerField)

...which is easier to write than:

Evaluate ( "GetAsText ("")" ; triggerField )

--sd

Good idea, Soren! :wink2:

But Evaluate() isn't needed, I don't think ... On textField: If ( not IsEmpty ( trigger ) ; textField )

All fields with this Auto-Enter (Replace) will clear as long as the field referenced (itself) is within the same table as trigger.

UPDATE: Also - can't the trigger be (should be) a global (within same table)? Ahh, comes right back to Comment's discussions of late. Powerful stuff...

Edited by Guest

So, changing "many fields" to auto-enter is more efficient than repeating the Clear Field script step as many times?

How about a simple:

Go to Layout [ manyFields ]

Show All Records

Delete All Records

New Record/Request

But, if those records contain fields that I didn't want to delete ?

lindsay said that she wished to delete only the fields of that layout !

I still think that repeating the Clear Field script step is the best way.

Point taken, Michael and my original suggestion also. I was just saying that Evaluate() wasn't needed specifically, if that was an option being considered. Agreed, create the record, enter the data, delete the record. :wink2:

" still think that repeating the Clear Field script step is the best way. "

Depends upon how important it is. If it's critical that it be right, I'd rather use an Auto-Enter (Replace). Scripts can trash partway through.

UPDATE: And if only some fields should be cleared, why not use globals for those fields instead? Obviously they wouldn't contain data you'd wish to hang on to.

UPDATE: I, as Soren, question the process here. If there are that many fields to set and clear, something is amiss...

Edited by Guest
Added Update

The way I understand it, the layout is being used as a glorified typewriter.

If the layout belongs to a table that is also used for something else, then that's not good.

The way I understand it, the layout is being used as a glorified typewriter.

:iagree:

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.