2 Replies Latest reply on Jul 14, 2013 9:03 PM by JojoYaya

    How to set auto create Serial with string infront(alphabets)

    JojoYaya

      Title

      How to set auto create Serial with string infront(alphabets)

      Post

           Hi, i have searched the forum on how to do this. But i cant get a clear concept on how to make it.

           I have fields--> ID, Name, Class(A to E)

           If i chose class A , i would like the serial to be A 1001, A 1002.....and if i chose class B, i would like the serial to be B 2001, B2002,....and so on....

           How can it possible to me to do so ? Thanks.....!

        • 1. Re: How to set auto create Serial with string infront(alphabets)
          philmodjunk

               Please do not use such an ID system as the primary key for linking records in one table to related records in others. Stick with a simple auto-entered serial number of Get ( UUID ) auto-entered value instead. Such a custom numbering system should only be employed when users require such and then you keep the value in the parent table for inclusion in reports and for searches/sorts, but not as a match field in relationships except for certain very limited purposes.

               The trick you can use is to set up a self-join relationship that matches on the Class table:

               YourTable::Class>-----<YourTable 2::Class

               Then this auto-enter calculation: Max ( YourTable 2::SerialValue ) + 1

               Can be used to assign the next serial value to the serialValue field of a new record. Typically, you need to clear both the "Do not evaluate if all referenced fields are empty and the "Do not replace existing value..." check boxes.

               If there is the slightest chance that two users might attempt to create new records in your table for the same class at the same time, you should also define a text field wth this auto-enter calculation: Class & SerialValue and set a unique values validation field option on it to guard against the chance that you might get two records with exactly the same combination of class and serial number value.

          • 2. Re: How to set auto create Serial with string infront(alphabets)
            JojoYaya

                 Thanks so much...i managed to do that...smiley