modify of a primary-key field from a codeunit

Hey I need to modify a primary-key field from a codeunit (and at the same time get the table relations updated). This can be done from a form, where the user are prompted with an confirm message (for examble changing of a customer number). But when I try to change the value from inside a codeunit, I get an error, telling that it’s not possible making a modify on a primary key. A way to overcome this is to make a copy of the table-record to a new record-variable and then change the value of the primary key before inserting, but in this way the table relations isn’t changed automatic. Is there a way to overcome this problem?? I realy hope someone will help me out here… Best Regards Jan Kristensen

For modifying fields in the primary key, you have to use RENAME instead of MODIFY. John

See REANAME istruction. Bye MArco