you should use the following XPath:
[MyFirstModule.PremiumRequest_RequestPackage = '[%CurrentObject%]']
The XPath you are using is returning all RequestPackages which have ARE referenced by A PremiumRequest
Unfortunately this does not work. I attached a picture. You can see, that the referenced objects are selected, but the data grid didn't seems to get the objectsUnfortunately this does not work. I attached a picture. You can see, that the referenced objects are selected, but the data grid didn't seems to get the objects...
When I try [MyFirstModule.PremiumRequest_RequestPackage/MyFirstModule.PremiumRequest = '[%CurrentObject%]'] I get an exception:
An error has occurred while handling the request. [User 'uidn6797' with session id '0691f36e-XXXX-XXXX-XXXX-XXXXXXXXb6b6' and roles 'Administrator']
--------
com.mendix.core.CoreRuntimeException: Exception occurred in action '{"xpath":"//MyFirstModule.RequestPackage[MyFirstModule.PremiumRequest_RequestPackage/MyFirstModule.PremiumRequest = '28428972647777557']","amount":20,"offset":0,"returnsCount":true,"sort":[],"type":"RetrieveXPathSchemaRawAction"}', all database changes executed by this action were rolled back
at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.processErrorState(CoreActionHandlerImpl.scala:151)
Caused by: com.mendix.connectionbus.ConnectionBusRuntimeException: An exception has occurred for the following request(s):
InternalLimitedXPathTextGetRequest (depth = -1, amount = 20): //MyFirstModule.RequestPackage[MyFirstModule.PremiumRequest_RequestPackage/MyFirstModule.PremiumRequest = '28428972647777557']
at com.mendix.connectionbus.RequestAnalyzer.doRequest(RequestAnalyzer.java:63)
Caused by: com.mendix.connectionbus.ConnectionBusRuntimeException: 'MyFirstModule.PremiumRequest_RequestPackage' is not a valid entity type., exception occurred on mapping the following query: SELECT x1MyFirstModule.RequestPackage.ID FROM MyFirstModule.RequestPackage AS x1MyFirstModule.RequestPackage INNER JOIN x1MyFirstModule.RequestPackage/MyFirstModule.PremiumRequest_RequestPackage AS j1myfirstmodule$premiumrequest_requestpackage WHERE x1MyFirstModule.RequestPackage/MyFirstModule.PremiumRequest_RequestPackage/MyFirstModule.PremiumRequest = '28428972647777557', exception occurred on mapping the following query: SELECT MyFirstModule.RequestPackage/* FROM MyFirstModule.RequestPackage WHERE MyFirstModule.RequestPackage.ID IN (SELECT x1MyFirstModule.RequestPackage.ID FROM MyFirstModule.RequestPackage AS x1MyFirstModule.RequestPackage INNER JOIN x1MyFirstModule.RequestPackage/MyFirstModule.PremiumRequest_RequestPackage AS j1myfirstmodule$premiumrequest_requestpackage WHERE x1MyFirstModule.RequestPackage/MyFirstModule.PremiumRequest_RequestPackage/MyFirstModule.PremiumRequest = '28428972647777557') LIMIT 20
at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.getMappedQueries(QueryMapper.java:281)
Caused by: com.mendix.connectionbus.ConnectionBusRuntimeException: 'MyFirstModule.PremiumRequest_RequestPackage' is not a valid entity type., exception occurred on mapping the following query: SELECT x1MyFirstModule.RequestPackage.ID FROM MyFirstModule.RequestPackage AS x1MyFirstModule.RequestPackage INNER JOIN x1MyFirstModule.RequestPackage/MyFirstModule.PremiumRequest_RequestPackage AS j1myfirstmodule$premiumrequest_requestpackage WHERE x1MyFirstModule.RequestPackage/MyFirstModule.PremiumRequest_RequestPackage/MyFirstModule.PremiumRequest = '28428972647777557'
at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.getMappedQueries(QueryMapper.java:281)
Caused by: com.mendix.connectionbus.ConnectionBusRuntimeException: 'MyFirstModule.PremiumRequest_RequestPackage' is not a valid entity type.
at com.mendix.connectionbus.util.LegacyModel.$anonfun$getMetaObject$1(LegacyModel.scala:43)
I show you part of the data model. It is not the simplest…
You should open the image in a different panel to see it correctly...
I read the following documentation:
https://docs.mendix.com/refguide/xpath-source
It states, that “If XPath is selected as the data source for a widget then the object or objects shown are retrieved directly from the database with a query. ”
Does this mean, that non committed objects cannot be retrieved by XPath? So I cannot use XPath on a newly created object in the context of a page, which is not committed yet?