RENAME and posted documents

Hi everyone,
One of my customers wants to rename several items in his database.
I created a table with two columns: “Old Code” to store the current item codes and “New Code” to store the new cpdes my cutomer wants to use.
I created a codeunit with the following code in the OnRun trigger:

recItem.RESET;
recNewItem.RESET;

IF recNewItem.FINDSET THEN BEGIN
REPEAT
IF recItem.GET(recNewItem."Old Code") THEN recItem.RENAME(recNewItem."New Code");
UNTIL (recNewItem.NEXT=0);
END;

My question is: would my code affect the posted documents, for example the posted shipment, the posted invoices,etc…
Would it change the item codes there as well or I need to write more code to do it???

Hi Poppins,

As long as you’re not trying to “merge” different items numbers into one, then you should not run into any problems. NAV will do the rename in all tables where the field is used as a direct table relation to the item table. So as long is you don’t have any customizations which are coded “in-correctly”, then you’re good.