July 15, 200223 yr hi everyone, i was wondering if there was a way to create/duplicate lets say 5 records using a calculation or script. what i want is to ask how many records you want to create and what ever number is in that field it will create that many records. thanks Peter
July 15, 200223 yr One way is when you begin a LOOP, set the LOOPCOUNT field match the amount of times you want the Loop to run, and then, in the loop script itself, have it deduct 1 from the LOOPCOUNT field each time it loops. Finally, as the first step of the Loop, place a conditional that Exits the Loop script if LOOPCOUNT is zero.
July 16, 200223 yr Author ok that sounds good, but the problem that i keep having is that the loopcount will be a number that the user would input. so here is what i have: loop exit loop if["loopcount=0"] exit loop all i need it to do is make a duplicate records (duplicate the number of times indicated in the loopcount) of the current one. i tried using some of the status functions. any help would would be greatly appreciated. peter
July 16, 200223 yr I used the following script to create blank records. New Record/Request Loop Enter Browse Mode Perform Find[Restore] Exit Loop If["Status(CurrentFoundCount)=Number of Records"] New Record/Request End Loop Set up the find to look for empty values in any field and store this find in your script. Create a global number field to use for the number of records you want to create. I named it "Number of Records". You could modify this to create duplicate records by using the Duplicate Record/Request step instead of New Record/Request. You would need to script the find to look for a value that only the original record and the duplicates would would have. Enter Find Mode Insert Calculated Result["YourField,Result"] Perform Find Hope this helps
July 16, 200223 yr ok that sounds good, but the problem that i keep having is that the loopcount will be a number that the user would input. That's not a problem. They can enter any number they want, and the script will follow from it. If you're worried about the LOOPCOUNT field getting in the way, just make it be an extra, temporary field, whose sole purpose is to specify how often the Loop will run when you trigger the script. You can make it a Global field, but on a network that would just get in the way. I recommend using a straight number field.
Create an account or sign in to comment