Add new object by Java API

0
Hi, All. I am beginner of Mendix.  I wonder how to make a new object by Java APIs. I got the way to access to the selected object (Row) on the Data-grid by Java APIs,  by using methods of IMendixObject and  some proxies of  entities I defined like below code. Map<String, ? extends IMendixObjectMember<?>> map =this.__CalSet.getMembers(getContext()); for (Map.Entry<String, ? extends IMendixObjectMember<?>> entry:map.entrySet()) { System.out.println(entry.getKey()+":"+this.__CalSet.getValue(getContext(), entry.getKey())); } this.CalSet.setDescription("textFromJava"); But, I have no knowledge to make a new object (add a new row) by java APIs. How do I access to NOT selected objects? How do I create the new?  Of course, I know the way to use MicroFlow for adding objects.  But, the way make me decrease the freedom for programming. Please teach me that. Regards  
asked
2 answers
2

If ever in doubt about Java syntax I suggest looking through the java documentation or even better through app store modules and how it’s done there – it’s generally easier to get a practical example this way.

And to answer your question, here’s how you’d create an object of type account:

Core.instantiate(context, Account.getType());

Hope this helps

answered
1

Thank you million of advise.

I tried that, I can have not created a new row at present.
Maybe, it comes from my mistaking of usage “Core.instantiate”.

AS you said, I will learn the correct use from some practical example.
I had look for such a example.  The App Store modules was a blind spot!
 

Thank you very much!

answered