Managing Visibility Via Xpath

0
Hello,  I am in the process of setting up a customer portal. I have modified the system where user accounts are also not associated to a customer and also a specific customer location. I am trying to control the system access so that the users can see an overview page that only displays the orders pertaining to them/their assigned location.  I have tried constraining this at the Domain Model level and also on the data grid level specifically, both to no avail. When I put in the following constraint, nothing appears: [System.owner/System.User/System.Session_User/System.Session/System.Session_User/Administration.Account/Administration.Account_Customer_Locations = Module1.Order_Customer_Locations]  I have tried several similar xpath constraints and I am not sure why it is simply showing nothing,  Additionally, I cannot use path to owner, because we may also enter orders for customers on their behalf if needed.  Also when trying: [Module1.Order_Customer_Locations/Module1.Customer_Locations = Module1.Order_Account/Administration.Account/Administration.Account_Customer_Locations/Module1.Customer_Locations] The following error appears:  com.mendix.core.CoreRuntimeException: Exception occurred in action '{"xpath":"//Module1.Order[Module1.Order_Customer_Locations/Module1.Customer_Locations = Module1.Order_Account/Administration.Account/Administration.Account_Customer_Locations/Module1.Customer_Locations]","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): //Module1.Order[Module1.Order_Customer_Locations/Module1.Customer_Locations = Module1.Order_Account/Administration.Account/Administration.Account_Customer_Locations/Module1.Customer_Locations]     at com.mendix.connectionbus.RequestAnalyzer.doRequest(RequestAnalyzer.java:63) Caused by: com.mendix.connectionbus.ConnectionBusRuntimeException: 'Module1.Order_Customer_Locations' is not a valid entity type., exception occurred on mapping the following query: SELECT x1Module1.Order.ID FROM Module1.Order AS x1Module1.Order INNER JOIN x1Module1.Order/Module1.Order_Customer_Locations AS j1module1$order_customer_locations WHERE x1Module1.Order/Module1.Order_Customer_Locations/Module1.Customer_Locations = x1Module1.Order/Module1.Order_Account/Administration.Account/Administration.Account_Customer_Locations/Module1.Customer_Locations, exception occurred on mapping the following query: SELECT Module1.Order/* FROM Module1.Order WHERE Module1.Order.ID IN (SELECT x1Module1.Order.ID FROM Module1.Order AS x1Module1.Order INNER JOIN x1Module1.Order/Module1.Order_Customer_Locations AS j1module1$order_customer_locations WHERE x1Module1.Order/Module1.Order_Customer_Locations/Module1.Customer_Locations = x1Module1.Order/Module1.Order_Account/Administration.Account/Administration.Account_Customer_Locations/Module1.Customer_Locations) LIMIT 20     at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.getMappedQueries(QueryMapper.java:281) Caused by: com.mendix.connectionbus.ConnectionBusRuntimeException: 'Module1.Order_Customer_Locations' is not a valid entity type., exception occurred on mapping the following query: SELECT x1Module1.Order.ID FROM Module1.Order AS x1Module1.Order INNER JOIN x1Module1.Order/Module1.Order_Customer_Locations AS j1module1$order_customer_locations WHERE x1Module1.Order/Module1.Order_Customer_Locations/Module1.Customer_Locations = x1Module1.Order/Module1.Order_Account/Administration.Account/Administration.Account_Customer_Locations/Module1.Customer_Locations     at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.getMappedQueries(QueryMapper.java:281) Caused by: com.mendix.connectionbus.ConnectionBusRuntimeException: 'Module1.Order_Customer_Locations' is not a valid entity type.     Any advice would be greatly appreciated. 
asked
1 answers
0

I would use a Microflow as a Datasource:

https://docs.mendix.com/refguide/microflow-source

answered