Saubs Posted December 3, 2003 Posted December 3, 2003 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?
djgogi Posted December 3, 2003 Posted December 3, 2003 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
bruceR Posted December 4, 2003 Posted December 4, 2003 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 WhiskyWolf Posted December 5, 2003 Newbies Posted December 5, 2003 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now