3

I need to get the Id of the user logged in community for Visualforce Page. How can I get the login user in salesforce community and use in Visualforce Page?

5

In Visualforce, you can reference the User global variable.

{!$User.Id}

In Apex, UserInfo methods should work just fine in the context of communities:

Id runningUserId = UserInfo.getUserId();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.