How to declare list in java action call

0
Hey guys need your help here, how should I declare a list of BatchList entitiy. 
asked
1 answers
5

You firstly need to create a list of IMendixObject. Then you create your Mendix entities and add them to the list as MendixObjects. Finally you return them from the Java Action.

Here is some example code that should help you.
 

// Create the List
List<IMendixObject> returnList = new ArrayList<IMendixObject>();

// Create a new BatchList entity
BatchList batchList = new BatchList(getContext());
batchList.setMachineName("Test Machine");
batchList.setPlantName("Test Plant");

// Add to the List
returnList.add(batchList.getMendixObject());

// Return the List from the Java Action
return returnList;


Good luck!

answered