August 2, 200520 yr 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
August 2, 200520 yr Hi, take a look at the "Set Next Serial Value" script step. That should do pretty much what you want. Regards, Peter
August 2, 200520 yr 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 )
August 3, 200520 yr 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.)
August 3, 200520 yr 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.
August 3, 200520 yr 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.
Create an account or sign in to comment