How to convert the string into IMendixObject

1
Please tell me how to convert the string parameter into IMendixObject Object and also convert that IMendixObject into string
asked
2 answers
2

Assuming that your entity is called "Person" and the attribute you are trying to set is called "Name" here is the code in Java that would create the object and set the attribute:

String param = "John Doe";
IMendixObject imo = Core.instantiate(context, "MyFirstModule.Person");
imo.setValue(context,"Name",param);

Hope this helps,

Andrej

answered
0

If the string would be an object identifier, you are best of doing a Core.getXpathRequest().

If it's not, we'd need a bit more information on what you are trying to do. A String can't really be converted to a MendixObject representation otherwise.

answered