How can I programatically retrieve the name of an Object over active associations?

0
Hi guys   I am wondering whether I can retrieve the active objects over the associations from an Object.   For example: ShoppingCart object could have many associations to many different Products which are all different objects, whereby each Product has a Name. So I want to know programmatically the Names of  the associated Objects of the shoppingCart (if there are) Is this possible?  
asked
2 answers
0

Yes, you can use the Mx Model Reflection module and retrieve that information from the database after the model reflection module is installed and the data is refreshed.

answered
0

The way I interpret this question is that you're using inheritance where Product is you generalization. You want to know the types of Products associated.

 

I think you can do this only in a Java action by using IMendixObject.getType() (which I would hope returns the full name of the type, but I dunno since it's not documented properly).

 

So create a Java action that has one input parameter, a generic object type thing. Only code this owuld contain would be:

 

{

if (InputObject == null) return null

return InputObject.getType()

}

 

or something along these lines.

 

Then you can call this Java aciton for every Product in your ShoppingCart.

answered