1 Reply Latest reply on Dec 5, 2013 9:43 AM by philmodjunk

    How to add increasing numbers in a field on a duplicate record

    AliSheikh

      Title

      How to add increasing numbers in a field on a duplicate record

      Post

           Hello,

                  I have a field called part_name on an items layout . What I'm trying to do is to get this field to show an, r1, r2 and so on, at the end of the part's name, each time I duplicate that record.

            

           So for example I have a part with a part name called Delta. WHen I duplicate the record delta, I want the new duplicate record to show delta r1 . When I duplicate delta r1, I want the new duplicate to show delta r2, and so on.

            

           P.S. part_name is not a unique identifier, its just a text field.

            

           Any help would be appreciated, thanks.

        • 1. Re: How to add increasing numbers in a field on a duplicate record
          philmodjunk

               You'll need to keep the part name and the "r1", "r2"... value in separate fields. You can use merge fields or a calculation to combine them, but part name will need to be kept separate in order for this method to work.

               Define a self join relationship that matches records by part name:

               Parts::PartName = Parts|SameName::PartName

               Then you can set up an auto-enter calculation on the revision field as:

               Max ( Parts|SameName::revision ) + 1

               Clear the "do not replace existing value" check box and you may need to commit records and/or refresh the window before you see the value update in the new record.