Hi everyone,
Has anyone ever had to rename a whole table of master records such as the Item table where there are many other tables that must get renamed also and where there are many, many items to rename??
I have a clients that wants to rename all the items in the item table - they have 250,000 items and it takes 2-3 minutes to rename each one. This happens if you do it manually or if you run a codeunit, report etc. If I try running the code in a database with 7,000 items it takes only a few minutes for the whole table to be renamed.
Any help on this would greatly be appreciated!
0
Comments
Hope this helps.
I have tried with modify(true) but no results.
Can anyone help me?
best regards.
Rizal
From the C/SIDE online help:
<start quote>
RENAME
Use this function to change a primary key in a C/SIDE table.
[Ok]:= Record.RENAME(Value1, [Value2],...)
Ok
Data type: boolean
This tells you whether the system was able to rename the primary key or not. Typically, the system will return FALSE if the record does not exist or if you do not have permission to write to the table.
Record
Data type: record
The record that contains the primary key that you want to change.
Value1, Value2, ...
Data type: text
The new values for the primary key.
<end quote>
I have also already tried that ways before but still no result.
It comes such error messages:
"Too many key fields were specified, so Item could not be retrieved.
The number of fields in the primary key is 1."
Do you have any idea?
Thanks before for your advice.
Regards,
Rizal
Item.Rename("No.","No"+'S');
Item.VALIDATE("No.");
Item.Modify(TRUE);
Your sincerely,
Rizal
Item.GET('70000');
Item.RENAME('70000new');
Thanks a lot, Luc!!
Now we can rename 2 million item.
Have a nice weekend
Rizal