3 Replies Latest reply on Dec 16, 2013 2:10 PM by philmodjunk

    Duplicate latest related record?

    EP

      Title

      Duplicate latest related record?

      Post

           I have a parent table with many related records.
           Is there a script I can write that will create a new related record, but duplicate all data from fields in the most current related record?  (For use with a button)

            

           Thanks

        • 1. Re: Duplicate latest related record?
          philmodjunk

               If your relationship is unsorted (the default option), then the most recent related record is the Last related record:

               If [ Not Isempty ( RelatedTable::neveremptyfield ) //make sure that at least one related record exists ]
                  Freeze Window
                  Go To Related Record [Show only related records; From table: RelatedTable; Using layout: "RelatedTable" (RelatedTable)  ]
                  Go To Record/Request/Page [Last]
                  Duplicate Record
                  Go to Layout [Original Layout]
               End If

          • 2. Re: Duplicate latest related record?
            EP

                 Thanks, the duplicate will have a different serial number, correct?  Basically, I'm adding a new record but copying everything from the last record.

            • 3. Re: Duplicate latest related record?
              philmodjunk

                   If the serial number is an auto-entered serial number, yes. If you have a portal to the related table, you'll see a new duplicate row appear in your portal each time you run this script.