Change Object Type

3
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?
asked
4 answers
1

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 https://world.mendix.com/display/refguide5/Inheritance+Split

answered
1

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

answered
1

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.

Regards,

Ronald

answered
0

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());
answered