Jump to content

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

Recommended Posts

Posted

I am creating multiple records with a single script step. Each of these records is blank, except I am numbering them using the Auto-enter Serial option. When I set the starting number to "1" and then increment by "1" all works well. However, if I delete all records and build another set, of course the numbering of each record picks up where it left off. My question is is there a way via a script to reset the initial value back to "1' without entering Define Database, etc.? If not, perhaps I could do my auto record numbering in a different way? Thanks in advance for any suggestions.

Kirk

Posted

If the serialised field is to be use as a key field for relationships then don't go changing it at all. Leave the gaps. The risk of ending up with duplicate keys is too great. (Duplicate keys screw up relationships big time... like having two people with the same lottery ticket number.)

Posted

As Vaugn said, espically if the field is part of a relationship. I usually use ID Keys such as.

Get(FileName) & "-" & GetAsNumber(Get(CurrentTimestamp)) & "-" & Ceiling (Random * 9)

But it doesn't matter what you set it as, you just want to make sure that your ID key is never duplicated. If its for a relationship you want to make each new record have a uniuqe IDKey.

Posted

SLIGHTLY OFF TOPIC:

FileName is always FileName.

CurrentTimestamp changes once every second.

Ceiling (Random * 9) returns one of 9 possible numbers.

Therefore, if user/s create two new records within a one second interval, in 1 case out of 9 (on average) they will be issued the same ID.

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