Jump to content

auto create records?


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

Recommended Posts

I have the following script to create records like Company A1 thr A5, B1 thru B5..etc. It's creating the records, but not the sequence number 1 to 5 (As and Bs show up). What did I do wrong?

Set field [gCounter, gCounter=1]

Loop

Duplicate record/request

set field [gCounter, gCounter+1]

set field [combination_field, numToText[company] & number-field]

Exit loop if [gCounter=5]

End loop

Link to comment
Share on other sites

quote:

Originally posted by caseyi:

I have the following script to create records like Company A1 thr A5, B1 thru B5..etc. It's creating the records, but not the sequence number 1 to 5 (As and Bs show up). What did I do wrong?

Set field [gCounter, gCounter=1]

Loop

Duplicate record/request

set field [gCounter, gCounter+1]

set field [combination_field, numToText[company] & number-field]

Exit loop if [gCounter=5]

End loop

Assuming that "company" is a text field, "number-field" is a number field and that "combination-field" is also a text field.

Then your set field should look like this:set field [combination_field, company & numtotext [number-field]].

Everything else looks OK.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Consultant

Database Resources

mailto:[email protected]

http://www.database-resources.com

=-=-=-=-=-=-=-=-=-=-=-=-=

Link to comment
Share on other sites

You don't have a script step to set the number field (I assume you want number_field to equal the current gCounter). Hence:

Set field [gCounter, gCounter=1]

Loop

Duplicate record/request

Set field [gCounter, gCounter+1]

Set field [number_field, gCounter]

Set field [combination_field, company & numToText[number-field]]

Exit loop if [gCounter=5]

End loop

Amazing how picky scripting can be.

HTH,

Dan

Link to comment
Share on other sites

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