Change Object Type

How does mendix identify the object type other than using the column submeta object name in the table of the entity? I have an entity workspace that is generalized from the entity account, and I would like to change an object of type workspace to an account. Is there a way to do so?
4 answers

Edit 1: if an object is already created in Mendix I don't know a way to change it directly to a another type. You can create the new object, copy attributes and delete the old one.

old incorrect answer :

Inheritance split


If you want to change an object of type workspace to an object of type account, you can find your answer in this thread.


Sorry if I misread your question, but do you mean that you would like to delete the workspace object but keep the account object? Since workspace is a generalisation of account you should create a new account object and copy the account fields from workspace to the new account object and delete the workspace object. You can not transform the workspace object back to only a account object.

If I misread the question you may want to clarify what you want to achieve here.




For a custom login action, we used the following, where user is a System.User obect and NatuurlijkPersoon is a specialization.

if (user.getMendixObject().getType().equals(NatuurlijkPersoon.getType())) {
        NatuurlijkPersoon persoon = NatuurlijkPersoon.initialize(getContext(), user.getMendixObject());