December 3, 200322 yr 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?
December 3, 200322 yr 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
December 4, 200322 yr 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..
December 5, 200322 yr 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