Use attributes of the account in a datagrid

0
Hello everyone, I have a problem when I try to access to attributes of the account entity in a datagrid. I need to display only the objects that have the same “type of owner” than the current user (I called it a hub of users). I saw that I could access to ‘[%currentUser%]’ which returns the user object, but I need to compare a specific attribute of this user (the “hub” attribute) to the one of my object in order to know if I display it in the datagrid or not.  In XPath I didn’t find any solution to this problem. I found 2 other solutions that are not enough for what I need :  1 – Doing the data selection in a microflow that returns into the datagrid the list of objects selected => The problem of this solution is that I can’t sort the data in a microflow sourced datagrid. 2 – I created a boolean in my object that I edit through a microflow at every single load of the page. It works also well but when 2 users are connected in the same time, the commit of the boolean of the 1st user is overriding the boolean commited by the 2nd one, and so this displays the wrong data for each of them.   Would you have another idea in order to do what I need in mendix ?
asked
4 answers
2

Finally I managed to do it like you both said with a surrounding data view, around my datagrid, and by creating a link between my hub entity and my object, in order to put the source as an association between the 2.

Thank you both for the help.

answered
0

Why is 'hub' an attribute in this case? 
If you create an entity for it and associate all of your accounts with the hub, you can simply retrieve all accounts with the same hub entity as the current user.

answered
0

determine the owner of the current user and pass that owner object in a surrounding dataview, limit the account list by using the dataview object (currentobject). This is pretty much the same solution as suggested by Larn ;)

answered
0

Does someone have an idea to access to these attributes in XPath ? 

answered