Filling Enums

We are working on an enumeration which will be kinda big... (think around 500 entries) Normaly I would do this using tables and scripts etc. but I will need this for at least two of our projects (and for different clients), and as all codes are essentialy a worldwide standard, having them in enumeration(s) will be handy. However, manualy filling these is a bitch... Is there a way around this??
3 answers

I agree with Samet, 500 entries for a single enumeration is not wise. You need to create a separate module for this, which has a object for the values you want. Then all you need to do is enter the data once into your first application and then export the module/import the module to your other application. When you have the module in your new application you could create a microflow/webservice to expose the enumeration data from your first system. You could then use that webservice to import the data into your new system, this way you have two systems in sync. Alternatively you could go to the SQL database of your first application and export the table to excel and import it into your new application database.

Another way you could do it is have a single application that contains all the codes and you could expose them via webservices. This way you would have one datasource but multiple applications using the same codes. So you would only need to update the codes in one place. I hope this helps?


Maybe an excel-to-modeler-enumeration feature request in the partner poratl would make sense. Although that does not immediately solve your problem.

Or, if you really insist to do it somehow automated: If you export a module (as simple as possible) with the (empty) enum, and extract the .mpk file (which is a zip archive), you can edit the .mpr file with a SQLLite editor (which should not be to hard to find). I know that some guys successfully used this approach, so it might be a temporary work around.

But in general i agree with the statement that enumerations should not be that big.


I don't think it's wise to add 500 enumerations. First of all you'll need to deploy the application with each change to the enumeration list. And with such al large list you should create a generic object with can be managed with a datagrid and dataview. Filling this list for the first time is always annoying, but it must be done by someone