web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Rename Id

(2) ShareShare
ReportReport
Posted on by 434
Hi,
 
We have a custom table, if we click rename from the UI, it doesn't get updated but it's references get updated (i mean for tables with relation to this table, the value gets updated but the main table stays as is)
Why?
Categories:
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    299,022 Super User 2025 Season 2 on at
    Rename Id
    Hi Deldyn,
     
    Maybe you can try to temporarily remove the table relations and see if then the renaming feature is working. You can also duplicate the current table to check the behavior.
  • DELDYN Profile Picture
    434 on at
    Rename Id
    Hi @André Arnaud de Calavon,

    No i can't see any weird x++ code that would do this. Any ideas of what i should do next?

    Hi @Anton Venter,
     
    yes alternate key is yes, and replacement key is filled with that index
     
    regarding your question:
    From your previous post, what do you mean with this? "One of the related tables that gets updated, has a relation based on three fields".
     
    I meant that, the table has relations with multiple tables. And I mentioned in the question, that the related table Id gets renamed while the original table Id doesn't get renamed. So i'm saying the original table has a relation with the related table based on three fields. it's just an information i don't know if relations would cause the original table to not get updated
  • Suggested answer
    Anton Venter Profile Picture
    20,291 Super User 2025 Season 2 on at
    Rename Id
    Hi,
     
    For this to work properly, you need a single field primary key. That can be either a natural key like SalesId on SalesTable or RecID which is the primary key of a lot of tables in F&O. What is the primary key of your table?
     
    From your previous post, what do you mean with this? "One of the related tables that gets updated, has a relation based on three fields".
     
    In addition to what you have currently, have you set the Alternative Key property on the table index? And the Replacement Key property on the table?
     
     
     
     
     
     
     
     
     
     
     
     
     
  • André Arnaud de Calavon Profile Picture
    299,022 Super User 2025 Season 2 on at
    Rename Id
    Hi Deldyn,
     
    You are correct that renaming is a standard feature for the primary key field in case there is one field in the primary index. Initially, there is no additional X++ coding required to make it work. That was also why I asked if you had a primary index different from a record ID. You also mentioned the field is mandatory and not editable. These settings are correct.
     
    In particular cases, you can add X++ logic to handle specific scenarios where the standard behavior can't be used. E.g. Microsoft tried to add support for renaming products which was in preview, but it gave too much of data issues and this feature is pulled from the product.
     
    Are you aware of any additional X++ coding on record validation or when writing the record that can revert the value for renaming the record?
     
     
  • DELDYN Profile Picture
    434 on at
    Rename Id
    Hi @André Arnaud de Calavon,

    I thought this is a standard feature, and there is no code that needs to be added. Doesn't it work by itself?
     
    • For your first question:  Are you relying on the standard behavior of table and field properties
      • ​​​Can you please explain further as I don't know much information about this (but most probably the answer to your question is yes)
         
    • For your second question: did you add X++ coding for renaming records
      • No i didn't, but i tried a runnable class to rename it but same behaviour happened
         
    • For your third question: What table and field properties are used for the primary key field
      • How do i know that? or do you mean properties on the table?
        • I have and index with allow duplicate no which is an Id
        • The Primary index property and the clustered index property are filled with that index above
        • The Id field itself is Mandatory and allow edit false
           
    • For your forth question: It appears that you have the related tables set up based on the natural key field. Have you considered using a record ID reference?
      • What do you mean by natural key? One of the related tables that gets updated, has a relation based on three fields
      • What do you mean by record id reference? where do u want me to use it?
  • André Arnaud de Calavon Profile Picture
    299,022 Super User 2025 Season 2 on at
    Rename Id
    Hi Deldyn,
     
    Can you share some technical details about your table? Are you relying on the standard behavior of table and field properties, or did you add X++ coding for renaming records? What table and field properties are used for the primary key field? 
    It appears that you have the related tables set up based on the natural key field. Have you considered using a record ID reference?
  • Adis Profile Picture
    5,691 Super User 2025 Season 2 on at
    Rename Id
    Hi,
     
    Could you provide your code in order to examine the issue? I am not a developer, however, others may notice where the issue is.
     
    Another, or parallel approach would be to debug the process, so you get some insights what is happening.
     

    Kind regards, Adis

     

    If this helped, please mark it as "Verified" for others facing the same issue

    Keep in mind that it is possible to mark more than one answer as verified

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,206

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 847 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 596 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans