3 Replies Latest reply on Aug 5, 2010 8:19 AM by philmodjunk

    copying a found set with a new reference number as a copy set.

    fluffyone

      Title

      copying a found set with a new reference number as a copy set.

      Post

      Hi Group

      I want to copy a found set of records that are grouped by a number/code so each one has this number/code at the top of the form.

      I want to duplicate all these records but with a new number/code on them, so that I will then have two or more sets but each set will be different by their number/code.

      The reason for this is that I have a set of data that can have different scenarios, so I want to create the first set of data and then have copies of this so that I can manipulate the data in each set, giving me the different scenarios. This will minimise the data input as I will only change the relevant bit of data on the record on the new sets all the other fields will stay the same.

      Does this make sense?

      Regards Fluffy

        • 1. Re: copying a found set with a new reference number as a copy set.
          philmodjunk

          You can either perform a find or possibly use Go To Related Records to pull up your group of records in a layout based on the appropriate table. Then you can loop through the records, using Duplicate record to duplicate them and set field instructions to modify fields in the duplicated record. If you have data that will be applied to a sub-group of the total list, you can store that value in a variable.

          • 2. Re: copying a found set with a new reference number as a copy set.
            fluffyone

            Hi Phil

            Thanks for your reply, I have been looking into this more and what I would like to do if possible is:

            On the main record form I have a unique number that links all the related tables, I want to then have portals that pull in data from the related tables.

            I would like to duplicate the main record with a new one and a new unique number and have it copy all the portal data with the new number. So I will have my full duplicate to mess about with the data which will give me my different scenarios.

            Is this possible?

            Regards Fluffy 8-)

            • 3. Re: copying a found set with a new reference number as a copy set.
              philmodjunk

              Yes,

              Ninja and I have even discussed different variations of this exact process in two other threads here back before the big forum software change.

              Duplicate the parent record and capture the new record's serial number in a variable.

              Return to the original record and use either a find to find it's related records or Go To Related records to pull up the related records on a layout based on the related table instead of your parent record's table.

              Now loop through the records using duplicate record to first make a copy and then use set field and the variable that holds the new parent record's primary key to change the new record's foreign key to match that of the new parent record. The trick to watch out for is that duplicating a record makes the new record the current record so typical loop with go to next record, exit after last may trap you in an infinite loop if you aren't careful here. Do the duplicate record steps manually once and watch where the new record appears in the found set and you'll see what I mean.

              Once you've duplicated all the child records, return to your original layout, but make the new parent record current and you are done.