Entity id should not be zero, fetching first question object from table

0
I'm trying to get the first question object from my database table. Using a microflow with a 'Retrieve object activity'. I initialized the table with testdata and can view the testdata while running, using the build-in database viewer. My Microflow doesn't need input parameters, since it should grab the first object from an existing question table list in the database. It should only return the fetched question at the end. Microflow: The actual Retrieve Object Activity:   As can be seen in the image above, I'm trying to fetch the first question from the database table named "MyFirstModule.Question". I'm calling this microflow using a button. The microflow throws following error: com.mendix.modules.microflowengine.MicroflowException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.IllegalArgumentException: Entity id should be not zero     at MyFirstModule.StartEnquete (RetrieveByXPath : 'Retrieve Question from database') Advanced stacktrace:     at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:143) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.IllegalArgumentException: Entity id should be not zero     at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:176) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.IllegalArgumentException: Entity id should be not zero     at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:40) Caused by: java.lang.IllegalArgumentException: Entity id should be not zero     at com.mendix.core.objectmanagement.SchemeManagerImpl.getObjectType(SchemeManagerImpl.java:1431)     at com.mendix.core.objectmanagement.MendixIdentifier.getObjectType(MendixIdentifier.java:94)     at com.mendix.core.objectmanagement.MendixObjectImpl.setId(MendixObjectImpl.java:317)     at com.mendix.core.objectmanagement.SchemeManagerImpl.getInstance(SchemeManagerImpl.java:936)     at com.mendix.core.action.user.RetrieveXPathAction.executeAction(RetrieveXPathAction.java:53)     at com.mendix.core.action.user.RetrieveXPathAction.executeAction(RetrieveXPathAction.java:17)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49)     at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260)     at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248)     at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168)     at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36)     at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:172)     at com.mendix.core.component.InternalCore.retrieveXPathQuery(InternalCore.java:1163)     at com.mendix.core.component.InternalCore.retrieveXPathQuery(InternalCore.java:1129)     at com.mendix.modules.microflowengine.actions.mxobject.RetrieveByXPathAction.execute(RetrieveAction.scala:76)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:192)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:149)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49)     at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260)     at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248)     at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168)     at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36)     at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:172)     at com.mendix.core.component.InternalCore.execute(InternalCore.java:390)     at com.mendix.webui.actions.client.ExecuteAction.execute(ExecuteAction.java:144)     at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:311)     at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:301)     at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:301)     at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:143)     at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36)     at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(ActionDispatching.scala:145)     at scala.util.Try$.apply(Try.scala:192)     at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(ActionDispatching.scala:139)     at akka.actor.Actor$class.aroundReceive(Actor.scala:465)     at com.mendix.core.session.Worker.aroundReceive(ActionDispatching.scala:135)     at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)     at akka.actor.ActorCell.invoke(ActorCell.scala:487)     at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)     at akka.dispatch.Mailbox.run(Mailbox.scala:220)     at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)     at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)     at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)     at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)     at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)   With a clear message saying: "Entity id should be not zero". Do I need to specify which question with given Entity Id I want to get from the table? Seems a bit strange to me, since I just want to get the first one from the table, ordering questions doesn't matter for now.
asked
1 answers
5

You probably initialized the table by adding data through the database layer and not the mendix layer.

Each entity record in a mendix database should have a id, the so called entity id. By adding data through the mendix layer the id is generated. When adding custom data through an insert statement the id is zero.

answered