Renaming Chart of Accounts - how to change Key

Hi All, I have written a dataport that will rename the G/L Account. The dataport works fine except for the fact that when Renaming the G/L Account, NAvision goes to the G/L Entry table, VEndor LEdger Entry table etc to update the G/L Account No. reference. The problem that I have is that Navision by Default searches based on the Primary key, Is there anyway that I can change the key that the G/L Entry table uses when updating the G/L Account No. reference. I looked at the OnRename trigger but except fro the Last Modified DAte update there is no other code. What I want to do is when NAvision is trying to update the G/L Account No. field in the G/L Entry table, change the key reference to something other than the Entry No. that is uses by default. Is this even possible? I am trying to do this in Navision FInancials 2.60. Any help would be greatly appreciated. Thanks, Anu

I got a similar challenge. Mind sharing your code with me?

Instead of renaming the record, just delete it and insert a new one. You can then go change the G/L Entry and any other tables you want manually, sorting by any key you want. Is it more dangerous this way? Yeah, absolutely. Does it execute fast? Significantly.

Use the Developer’s Toolkit to find all of the table fields that have a relationship to the G/L Account No. and you can know it out pretty quickly. You would also want to test all database relationships when you’re done just to make sure you didn’t miss something.

I’ve done this a few times, and this is my way:
*Locate which tables cause the batch to work slow (perhaps 17, 21, 25, 111, 113, …?).

*Export theese table-objects to a FOB.

*In theese tables - locate all relations to table 15. Remember that a table might have more than one field relating to another table
Remove the relations. And perhaps you create a key for those fields.

*Make a batch that renames G/L accounts in theese tables, using command MODIFYALL. Remember top use the created key.

*Run your rename-batch to rename G/L Accounts.

*Import your original objects from the FOB - with REPLACE-option.

Once we did this, we had a rename-batch working for around 24 hours - and it was not even close to finish.
But using the procedure mentioned the job (finally) was completed after 2-3 hours!