Most of you who are familiar with the Dynamics 365 for Finance and Operations application, have probably used the standard Rename function. This function allows you to rename the primary key of almost any record. With this function, you can fix records that were saved or created by mistake. This function ensures data consistency, that is, all the related records are renamed as well. It can be accessed from the Record information form (shown in the following screenshot), which can be opened by selecting Record info from the right-click menu on any record:
A new form will open as follows:
Click on the Rename button to rename the Vendor Account field value.
When it comes to mass renaming, this function might be very time-consuming as you need to run it on every record. An alternative way of doing this is to create a job that automatically runs through all the required records and calls this function automatically.
This recipe will explain how the record's primary key can be renamed through the code. As an example, we will create a job that renames a vendor account.