How do I create a new value of an enum attribute via a page?

1
I have some many company´s name inside my Project (e.g. companies= {'Apple', 'Google', 'HP'}) and I wanna add some other new values via an overview page that I have created for this. I use an enumeration because I have saved a lot of examples and if I want to change the enumeration to String or another type my examples disappear. Anyone could help me with this? Thank you
asked
3 answers
1

Dear Alvos,

Your requirement can be met by creating a separate entity for each of the attribute for which you are using of type “Enum”.  Each such additional entity should be linked by one to many association with your base entity.

Of course then you can easily have overview  and edit pages to manage the data in these additional entities

Thanks,

Shekhar

answered
0

Not sure if I understand your question fully.

ENUM is a predefined list of values. If you have already made a list of Company names in ENUM and you want to add more company names to that ENUM, then must do this from Modeler. Not from Page. 

If you want to add new companies, then it must be an entity capturing the company details. 

What is the you are trying to do exactly?

answered
0

If you are using ENUM as a data type in your domain model, then you would have created the ENUM in modeler, which looks something like below. Also you would have added values for the ENUM in modeler only.

This means, you cannot add values to ENUM dynamically from a page, when the application is running.

If you want to add new values to ENUM, then you must add from the Mendix modeler, build it again and run the application. You can click NEW and add more values to ENUM

If you want to dynamically add companies when the application is running, then Company name cannot be a ENUM. You must remodel your application to have an entity to capture the Company as a record and not as an ENUM

answered