Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7663 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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

Posted

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
Posted

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

This topic is 7663 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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