June 1, 200520 yr 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.
June 1, 200520 yr 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
June 1, 200520 yr 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.
June 2, 200520 yr Author 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
June 2, 200520 yr 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
June 3, 200520 yr 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
June 3, 200520 yr Author 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?
June 3, 200520 yr Actually I'm using Tiger but they are behind the times here and don't let you choose that as your operating system.
Create an account or sign in to comment