You need to sign in to do that
Don't have an account?
Kalle Kalif
Getting data on the VIEWER of dashboard for Visualforce purposes
I have a visualforce page i am using in my dashboard, where i have a SOQL query with a
where owner.id='{!$User.Id}'
argument. Is there a way of changing $User.Id to $Dashboardviewer.id or similar?
Now i have to log in as the relevant user to see what he sees. It would be easier to simply change to him as the viewer.
So are you saying you want the ability to easily switch the $User.Id value with another known one? Is User done via a StandController right now, custom or extension?
I simply want to know what is the correct line of code to get the id of the dashboard viewer.
I have no controller for my page, getting data using Ajax toolkit, i.e.:
So:
Will always return the currently logged in user. To get another user, you would have to run SOQL for that user based on email, name, ID, etc.
Do you mean a situation like this: http://boards.developerforce.com/t5/Visualforce-Development/Running-User-in-Dynamic-Dashboard/td-p/304043
?
I have tried using the example in the post you linked to, like this
but it gives my ID every time, and not the id of the user I specify in "view dashboard as", which is my goal..