204
Views
1
Comments
Quick tip: Change the identifier of an entity
Discussion

Hi!

You know when you create an entity and Service Studio helpfully automatically creates it with a "Id" attribute, and sets it as the entity identifier?

Well, suppose that after publishing your eSpace you figure out you need a different identifier? For instance, if you need a text value instead of the default Integer (or Long Integer)...

You can try changing the identifier by going into the "More..." screen, but then you'll get an error saying that you can't do that. You fix that by going into the database itself and manually changing the data type there, but that sometimes is problematic (for example. you might not have access or permission to change the DB structure). Also, manually editing the database structure is usually a really bad idea.

Thing is, if you don't care about the data in the table there's a much easier way: simply cut (right-click on the entity name and choose cut) and then paste (right-click on the Entities folder and choose paste), and there you go, now you can change whatever you want in your entity.

True, in reality you're creating a brand new entity, but because it is absolutely identical to the previous one, Service Studio will automagically fix all the references to it.

Hope this helps!

2016-03-14 11-51-58
Carla Teixeira

Thank you for sharing this Carlos! :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.