mKirk Posted August 2, 2005 Posted August 2, 2005 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
PeterHW Posted August 2, 2005 Posted August 2, 2005 Hi, take a look at the "Set Next Serial Value" script step. That should do pretty much what you want. Regards, Peter
Zero Tolerence Posted August 2, 2005 Posted August 2, 2005 Also, if you wanted to say delete the second record and have all the other renumber accordingly, you could have an auto calc field witht this calculation: Get ( RecordNumber )
Vaughan Posted August 3, 2005 Posted August 3, 2005 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.)
Zero Tolerence Posted August 3, 2005 Posted August 3, 2005 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.
comment Posted August 3, 2005 Posted August 3, 2005 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now