How to implement a Mapping of different codes?

0
Hello all,   to improve my Mendix skills I'm always interresting in Best Practice solutions. In my Mendix App I have to implement a mapping for some codes of units of measure, e.g. Unit of Measure: Gram --> 'G' should be mapped to 'GRM' (approx 15 codes to be mapped).   I've implemented the mapping with an IF statement. It's working fine, but maybe it's not the best solution because with 15 codes it's becoming a very long IF statement. if $ComplaintData/CodeUOM = 'G' then 'GRM' else if $ComplaintData/CodeUOM = 'KG' then 'KGM' ...   Any hints for other solutions for the mapping are welcome. Thank you very much in Advance. Best regards from Stuttgart   Uwe
asked
1 answers
1

I would not worry about it. You only might want to create an enumeration on the Mendix side. Might help later in retrieving etc. And then you only have to make one flow that has a string as parameter where you pass the code and use a create enumeration action with all the 15 if statements that points to the right enumeration.

 

Regards,

Ronald

answered