Retrieving object using GUID in Java

I am trying to write an xpath constraint to retrieve a specific object in Java. I have seen that you can retrieve the GUID, which i have managed to get. But i need to know how to write the xpath query to obtain the object. I want to make it generic so i have passed the entity name as well. So i am assuming that if i have the entity name and GUID i can retrieve the object? Also is it possible to get the list of attributes that object has? This is what i have so far: List<IMendixObject> result = Core.retrieveXPathQuery(context, "//" + objectName + "[" + + "='" + objectID + "']")
3 answers

I think this will work. This single quotes might not be needed, depending on the GUID format (which can either be ID_<number> or just <number>):

"//" + objectName + "[id" + "='" + objectID + "']"

If you retrieve by a single Id it will always be a single object.

You can use Core.retrieveId(context, id) for that.

The list of attributes is called Members.

BTW The best way to find this is Eclipse.


Can one of the AppStore solutions help you, either with the functionality you want to build, or to give you inspiration how to collect object information? Mx Model reflexion or Object Browser