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

creating records using the a number in a field


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

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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

Posted

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.

This topic is 8165 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.