2 Replies Latest reply on May 18, 2011 10:43 AM by JantzSelk

    Trying to create a custom and unique serial/lot number

    JantzSelk

      Title

      Trying to create a custom and unique serial/lot number

      Post

      Hey Everyone, i need to create a field that is unique to each new record that is created. Ideally i would like to incorporate the first three letters of record title along along with the date the record was created. This field is meant to act as a "lot number" which allows each record to be unique and tracable. Does anyone know how i can do this? 

        • 1. Re: Trying to create a custom and unique serial/lot number
          philmodjunk

          I suggest you use an auto-entered serial number field instead. This is a built in feature you can easily use and it is designed to generate unique values even when several users are all accessing your database and created new records all at the same time.

          What you describe can be done, but in a multi-user environment, it is quite difficult to ensure that two users can't do this at the same time and thus get the same, duplicate value for a lot number.

          You can certainly define such a field and use it for search/sort/identification purposes, but I wouldn't use it in relationships to link to other data tables.

          Here's an auto-enter expression:

          Left ( Namefield ; 3 ) & Get ( CurrentDate )

          If you don't want to see the date divided by / characters, use a substitute function call to remove them:

          Left ( Namefield ; 3 ) & Substitute ( Get ( CurrentDate ) ; "/" ; "" )

          I'd add a validation rule to specify unique values on this field to catch cases where a second new record is created with the same 1st three letters on the same date.

          • 2. Re: Trying to create a custom and unique serial/lot number
            JantzSelk

            Hey Thanks, that helped a ton!