Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Duplicating records and their related records


This topic is 7113 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Am i mssing something that is really simple...

I have a table that has a couple of related tables hanging off of it. There are times when a user wishes to duplicate the main table AND its related records.

I am currently using a script that duplicates the main record, remembers the new records match field and then does a 'goto related records only' step and then loops through each of the related records to duplicate them and give them the new match field!!!! It's painful, clumsy and slow!!!!

ANy ideas would be greatly appreciated.

Posted

Steve:

That's pretty much the method, unfortunately, as you've got to update all the match fields. However, it shouldn't be "painful, clumsy and slow." Because you're using GTRR, it should be fairly speedy, even in a large data file.

-Stanley

Posted

There are times when a user wishes to duplicate the main table AND its related records.

If this really often happens, then create a new Table, import the related records there, set a global to the next ParentID, and import back into the original RelatedTable substituting the ParentID with the global value when importing.

Posted

Thanks for your answers. They will help to tidy up my script. It does seem odd however that this option has not been built into the duplicate command. Oh well.

Cheers

Posted

Steve:

I'd say that the reason duplicating related records is not built into the duplicate record command is that you don't always want to duplicate all the related records. In a job order, one related record will be the contact record, another might be the invoice, if one has been created. Duplicating these would make a mess of your data. So, it's a case of having to roll your own.

-Stanley

Posted

Note that on a Mac, it's a extremely simple. Requirement: a portal with auto-create related records turned on. A layout in the parent record that displays the portal and the parent record fields you want to copy. There should be no record ID fields and no calculated fields displayed on this layout.

If set up this way, perform applescript:

Create new record with data (get data current record)

See attached example.

AutocreatePortal.zip

Posted

Thanks Bruce,

Unfortunately the bunch i work for do not have the superior intellect to work with the ultimate OS: panther. I am stuck developing on an XP platform. I feel dirty!!!

I wonder if there is a similar script available for Windows?

Posted

Actually I'm using Tiger but they are behind the times here and don't let you choose that as your operating system.

This topic is 7113 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.