2 Replies Latest reply on Jan 21, 2015 7:42 AM by philmodjunk

    Duplicate record and relating

    JamesTudor

      Title

      Duplicate record and relating

      Post

      I can't find any post that has raised this issue if you know please could you direct me, otherwise can you help.

      Each record has a "serial number" i want to duplicate the record and all relating data records but give it a new serial number.

        • 1. Re: Duplicate record and relating
          SteveMartino

          From the top menu bar Records>Duplicate Record will create a duplicate record with a new serial number, if serial number field is set up as auto enter serial number field. 

          Now creating all the duplicate records in the related fields is another thing.  It seems odd to completely duplicate a record and all its related records.

          That would require a script that captures the primary key id of the existing record as well as the primary key of the duplicated record in variables, goes to related data, duplicates those records, then changes their foreign key, etc., the whole time with error checks so you don't change the wrong records if there is no related records.

          If you could explain more why you need this, more help could be provided.

          • 2. Re: Duplicate record and relating
            philmodjunk

            See the script at the end of this thread for a script that duplicates a parent record and also a set of related child records: Duplicating Bill Of Materials (duplicating portal line items)