retrieve current user

0
I'm expanding my webapp with a native section where a user can view specific data. I've created a working login page after which the user is redirected to the appropriate homepage with a dataview that is supposed to show data. Withouth any xpath, all data is shown in the dataview, but I can not seem to figure out how to set the xpath based on current user. I've tried: - making the login entity persistable, retrieve the first(and only) entry of the login, create xpath based on username from login compared to username from data entity, deleting the login object - retrieving currentuser with a javascript action call (as suggested in a related topic) - retrieving object from system.user - setting xpath in navigation synchronization (as opposed to inside a nanoflow, as this does seem to allow different associations)   Just to be clear about what the intention is: I need to retrieve an account object of the current logged in user Set an xpath that compares an attribute of the account to an attribute of the data entity, in this case the attribute is CompanyName.   Any help is appreciated.   Version is 10.9
asked
3 answers
0

So if I understand correctly you have added an attribute to the Administration.Account and want to compare this field with another data entity that also has this field CompanyName.

First try never to adjust Marketplace modules because if the module needs an update you will loose all your changes. Secondly it would be wiser to set a reference between the user and that data entity (let's call it Company for now). Third do note that a user has an account not is an account.

So let's say your domain model has an entity employee and an entity company you draw a reference between those two so that a company can have multipe employees. The employee has a one on one reference with account because each employee has only one account.

So it look like this. Now I want to retrieve the company of the current user. 

 

Now you have the company of that user.

Regards,

Ronald

answered
0

Hi Roy van Buul,

 

can you share your domain model, so that answer can be more accurate to your model.

answered
0

 

 

Click Here to view similar kind of question.

answered