Entitie Identifier

Entitie Identifier

  
Only to chek if I am making something wrong.

After create and publish a entitie (with a identifier - ID), I can not change later it name?

TIA
Solution
Hello Alberto,
 
You are allowed to change the name (and type) of the ID field of an entity, as long as it has not been published yet. However, once you have published it, it is no longer possible for you to change the name (nor the data type) of the ID field, nor can you create a new attribute and make it play the role of ID for that entity. Service Studio does let you change the name/type of the ID field (even after it has been published), but you will get an error at compile time informing you that it is not possible to do so. This is due to the fact that most databases are not very friendly in terms of supporting changes to the definition of the primary key of already created tables.
 
If you do not have any records for the entity whose ID you wish to change, you can always cut/paste the entity definition, which will lead to an entirely new table being created in the database, and after that you can change the name (and type) of the ID field. 
 
Unfortunately, if you already have data records, this workaround is no longer an option. In this case, if you really wish for an entity with an ID called in the way you want it to, you can create a new entity whose definition is the one that you want, and then create a process through which you transfer the data records from the "old" entity to the new definition. Once this has been acomplished, you can delete the old entity, and rename the new entity to have the name of the one that you deleted.
 
If you have any further questions, please do not hesitate to place them.
 
With best regards,
 
Stoyan
Solution
Thanks  Stoyan for your contribution
Only to add to the present discution... After Publish you can not change the name of un identifier, neither the autonumber property.