Dynamic Data Model

0
Hi all, Is it possible that a user creates data model entities during runtime? Concrete example: I want that each user is able to create several user-specific lists. These lists contain a user-specific amount of columns and the user can define the data type of the respective columns.  E.g. User 1 creates a table/list with 2 columns. Column 1 is a Date and Column 2 is a String User 2 creates a table/list with 3 column. Column 1 is an Integer, Column 2 is a Double and Column 3 is Binary.   Thanks and best regards, Tobias
asked
1 answers
0

No and yes.

 

No, because, domain model changes implies data base model changes, which are not possible to execute in mendix runtime, you have to recompile the Mendix app so that the new entity is created in your db schema and processed by mendix its metamodel etc.

Yes, You can create generic functionality and domain model entities wherein you can still reach similar usecase by entities in your domain model with objects like  "entity, columns, relations, datatypes", look for inspiration to the mx model reflection domain model how there a similiar way.

Another possibility is to write programatically a Typescript for Mendix platform SDK, wherein you create the enityty/attribute etc, which at the end again should committed (like in mx modeler as a revision), whereafter you again have to recompile your mendix app (db schema) so that the new entities are usable to Mendix...check for more info; https://docs.mendix.com/apidocs-mxsdk/mxsdk/creating-your-first-script

answered