What is the entity of objectid 123moredigits321

Got an objectid in one of our logs, but without any mention of the entity. How can I easily find the entity, without having to go through every entity in my app?   i did this idea that works great; https://community.mendix.com/link/space/xpath/ideas/2972, but it find s the object, as where i need to find the entity.   I got this far, but still need to replace the /ObjectType by something generic: // This file was generated by Mendix Studio Pro. // // WARNING: Only the following code will be retained when actions are regenerated: // - the import list // - the code between BEGIN USER CODE and END USER CODE // - the code between BEGIN EXTRA CODE and END EXTRA CODE // Other code you write will be lost the next time you deploy the project. // Special characters, e.g., é, ö, à, etc. are supported in comments. package developer.actions; import java.util.List; import org.apache.xml.security.binding.xmldsig.ObjectType; import com.mendix.core.Core; import com.mendix.systemwideinterfaces.core.IContext; import com.mendix.systemwideinterfaces.core.IMendixObject; import com.mendix.webui.CustomJavaAction; public class GetObjectsEntityByObjectId extends CustomJavaAction<IMendixObject> { private java.lang.Long ObjectId; private IMendixObject ObjectType; public GetObjectsEntityByObjectId(IContext context, java.lang.Long ObjectId, IMendixObject ObjectType) { super(context); this.ObjectId = ObjectId; this.ObjectType = ObjectType; } @java.lang.Override public IMendixObject executeAction() throws Exception { // BEGIN USER CODE String EntityId = first9digits(ObjectId); //retrieve all objects who are having their id starts with the entity id List<IMendixObject> mxObjects = Core.retrieveXPathQuery(getContext(), "//" + ObjectType + "[id=" + EntityId + "]"); if(mxObjects == null || mxObjects.isEmpty()) { return null; } else { IMendixObject mxObj =mxObjects.get(0); return mxObj; } // END USER CODE } /** * Returns a string representation of this action */ @java.lang.Override public java.lang.String toString() { return "GetObjectsEntityByObjectId"; } // BEGIN EXTRA CODE // END EXTRA CODE }   Anybody has an idea how to get the entity this way, or anyone has a better solution?
0 answers