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?


In Visualforce, you can reference the User global variable.


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

Id runningUserId = UserInfo.getUserId();
| improve this answer | |

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.