1 Reply Latest reply on Apr 18, 2014 7:19 AM by philmodjunk

    Duplicate and Edit Records

    TarraFarnham

      Title

      Duplicate and Edit Records

      Post


           Hey everyone.  I have a layout called "Master Training Plan" that has a portal called "Exercise Instance" on it.  I want to be able to duplicate the entire record (including the portal records), but also be able to edit them as needed once they're copied.  When I use the "Duplicate Record" function, it duplicates the record, and I can make changes to primary table "Master Training Plan" without it changing the information for that same field in the table I copied the information from.  However, if I try to edit the items in the portal in the new record, it changes the other portal as well.  Thoughts?

        • 1. Re: Duplicate and Edit Records
          philmodjunk

               However, if I try to edit the items in the portal in the new record, it changes the other portal as well.  Thoughts?

               That's because both records link to the same set of related records. The portal records were not duplicated. You need to duplicate the parent record, assign a new value to whatever field is used as a match field to the portal records and then find/duplicate the original parent record's portal records, updating the new portal records' match fields to match to the new match field of the newly created parent record.

               The following thread describes a script that will duplicate both parent and a set of related records (records in your portal), but it assumes that the match field linking the parent to the related records is an auto-entered serial number that will then automatically enter a new value when the record is duplicated.

               Thus, this script will either need to be modified to handle that detail explicitly in the script or you'll need to start using an auto-entered serial number as the match field in your parent record: Duplicating Bill Of Materials (duplicating portal line items)