Editing an attribute with Enum datatype

0
Hi all, We have a situation where, we have a list of possible values for a property. Example, assume the case of ‘transport’, which states the mode of transport to be used. We had earlier defined an enumeration and said ‘Bus’, ‘Car’ and ‘Bike’ are the possible values for the property ‘transport’. Then, we faced a situation where we should be able to add a new mode of transport and remove any mode of transport that is not supported any longer. So, upon reading through earlier questions posted on the forum, we realized that it is not possible to edit an enum except from the modeler. We wanted the supervisor to be able to edit the values in ‘transport’. So, we modified the app and converted the enum to an entity. This entity now contains a single attribute, which indicates the mode(bus or cycle or car). Is it right to use the earlier enum as the datatype of this attribute, by which we mean that the attribute of the entity could take any one of the values from the earlier enum. Or is there a way to set default values to this single attribute of the new entity? How do we edit/add/delete the values that this attribute can take?    
asked
2 answers
2

If you use the enum for that attribute, you’ll run into the same limitations of not being able to edit it. So it should probably be a string. You’ll want to run a conversion microflow where you retrieve all objects with the enum and replace them with an association to the correct objects of the new entity. Before running it, make sure you of course created these object as well. Either in the flow or in the app.

answered
0

Sytze is right. In addition to that: “How do we edit/add/delete the values that this attribute can take?”  Just generate an Overview- and NewEdit-page for the new entity. Take care at deleting a value: how will you handle objects that reference this value. Decide if you will modify them or clear them or not allow the value to be deleted when a reference exists.

answered