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.

Clearing Repeating Fields

Featured Replies

I've got 5 repeating fields in a layout, each showing 30 repetitions. Using ScriptMaker, I want to create a script that will clear all 30 of the repetitions in one step, rather than doing

Clear [select, "RepeatingField"-1]

Clear [select, "RepeatingField"-2]

Clear [select, "RepeatingField"-3]

Clear [select, "RepeatingField"-4]

through

Clear [select, "RepeatingField"-30]

for each of the fields. Can't figure out how. Any suggestions?

Use global empty repeated field(s) (of right type) with as many repetitions you need in conjunction with self relationship based on record id.

For ex if you have field recID define an self relationship selfRel.

Now set auto enter options for your repeated fields to lookup from field globalRepeatedField from relationship selfRel.

Finally when you want to clear your field(s) call the following script

Set Error Capture [on]

Freeze Window

Go to related record [selfRel, show only related]

Relookup[recID]

Exit Record

Dj

Sensei said:

I've got 5 repeating fields in a layout, each showing 30 repetitions. Using ScriptMaker, I want to create a script that will clear all 30 of the repetitions in one step, rather than doing

Clear [select, "RepeatingField"-1]

Clear [select, "RepeatingField"-2]

Clear [select, "RepeatingField"-3]

Clear [select, "RepeatingField"-4]

through

Clear [select, "RepeatingField"-30]

for each of the fields. Can't figure out how. Any suggestions?

First you should probably fix the design to avoid repeating fields.

If you're on a Mac it's easy with applescript

copy {"", "", ""} to emptyList -- except make it 30 items

copy emptyList to cell "Repeat1" of current record

copy emptyList to cell "Repeat2" of current record

-- etc..

  • Newbies

Hi, Sensai

Here's an ugly but effective method. It's certainly not recommended as a paragon of design efficiency, and it's not up to the standard of the previous two replies, but it will work in a pinch

Create a hidden layout, with only the repeating fields on it, then use a looping script such as go to field(your field)/loop/set field (no designation) [""]/go to next field/exit loop if status current repition number = 30/end loop

A word of caution ... be very certain that the 5 repeating fields are stacked vertically, not alongside each other - it would make the "go to next field" command rather exciting ..

I agree with Bruce, btw ... repeating fields have some uses, but in general they're more trouble than they're worth.

Wolf

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.