Jump to content

Creating multiple records from a script


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

Recommended Posts

  • Newbies

Not sure if this is the right area to post this.

I need to be able to create a number of records based on 2 numbers I enter. This will be something like : 0123-0001 to 0123-0035. I would like a new record for each number i.e., 0001, 0002, 0003 etc.

How would I do this, or are there any examples anywhere?

Thanks in advance for your help.

 

 

 

 

Link to comment
Share on other sites

Not sure what exactly your difficulty is. Assuming you have entered the start and end values into global fields, you could have your script do:

Loop
  Set Variable [ $value; Value:SerialIncrement ( YourTable::gStartValue ; $i ) ]
  New Record/Request
  Set Field [ YourTable::Value; $value ]
  Exit Loop If [ $value = YourTable::gEndValue ]
  Set Variable [ $i; Value:$i + 1 ]
End Loop
Commit Records/Requests 

Note that this does not test that the end value is a serial increment of the start value; if it is not, the loop will continue forever.
Nor does it test if the values already exist as records.

Link to comment
Share on other sites

This topic is 2297 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
 Share

×
×
  • Create New...

Important Information

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