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 Fields in ALL records

Featured Replies

I have used the ScriptMaker to clear 4 fields in a layout using the "Clear" script. This is working fine but I need a way to press a button to clear the four fields for ALL records, not just the current record being browsed.

Any ideas?

Once you've cleared the field, use the "Replace" command.

First either show all records, or find particular set you want to work on. the following script will loop thru the found set performing whatever steps you place just below the Loop step. Be carefull with this kind of loop, back up first, there is no undo if you mess up. I would recommend first writing the script without the loop steps (Loop,EndLoop), try it on a single record, if it works to your liking then put the loop steps in.

Goto Record/request/page [first]

Loop

---put your steps here----

go to record/request/page [exit after last,Next]

End Loop

Rod

  • Author

This worked great! Thanks!

Elgin

Why Loop? Why not 4 times Replace as was suggested by danjacoby?

  • Author

I didn't understand how to use the Replace suggested by danjacoby so I tried the other. Does Replace work better?

Hi,

Yes, it's quicker. While being in the field, using the replace function would replace the actual content (empty if cleared previously) in all records.

Show all records

Go to Layout

Go to Field (select)

Clear

Replace (no dialog)

Go to Field 2 (select)

Clear

.....

Fo to Field 4

Clear

Back where you where.

I'm just lazy, that's all.

I've started using looped Set Fields instead of Replace recently. I have a feeling it's faster but not sure -- it's definately not slower.

I recently spent half a day improving a complicated process that involved four looped Set Fields with (each Set Field looped through the found set individually) with one loop with the four Set Fields inside it, thinking it'd speed up the process. It made no difference (in fact the whole process was 5% slower!).

I don't like having a process rely on being on a particular layout with particular fields on it if at all possible.

  • Author

Thanks for the instructions... I appreciate it. B)-)

Elgin

Hi Vaughan,

My assuptions of Replace being quicker was based on what I've been reading in one other post here on the Forum.

I do not have a file in which I could reasonably test both methods but I keep it in mind...

Thanx.

Hi Vaughan,

Here was the thread. Not involving replace function but Copy All records though...

Pupiweb said

"Actually I usually opted for a looping script putting the IDs in the global (because it's not layout-dependent and doesn't require that the user has export privileges) but I discovered it's much slower (5 times slower) ..."

I finally run the test in my line item (8,264 records linked to many db) with a new field and a g_starthour and g_endhour in the script.

The delay result is B)

Replace function : 00:01:24

SetFieldLoop : 00:02:50.

Not 5 times, but twice quicker with Replace.

RE Vaughan's: I don't like having a process rely on being on a particular layout with particular fields on it if at all possible.

That is definitely *best* practice, no doubt about it.

IMHO and without test -- replace will be faster, but the field *must* be on layout and accessible.

Anatoli, you are soooo right!

And I'm the one who suggested the Replace idea.

Thanks Ugo for quantifying the results!

Is it possible you could share the file you used to perform the test?

Hi Vauhan,

It's a 18,8Mo file and a line item related to 14 db!!!! If you have a ftp, I could upload it to you. In the meanwhile, here are some system information.

Running on Imac Mac OS 8.6 3go/96Mo (first IMacs).

Really want to try it ? Would you think this kind of stuff would change (reverse) according to the system running ?

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.