Change entity using dynamic attribute

0
Is it possible to change the attribute of an enitity, where the attributename is a string? For example: I have the string values 'field1' and 'field2'. Now these fields need to be changed in the entity 'order', using the string values to identify the right attribute.
asked
1 answers
4

You can do this quite easily in a java action, to which you pass the order (order) and attributename(e.g. string):

 //Begin User Code
 order.getMendixObject().setValue(getContext(), attributename, attributevalue)
 order.commit();
 return true;
answered