Activity Forums Salesforce® Discussions How to get the UserID of all the currently logged in users using Salesforce Apex code?

  • shariq

    Member
    September 22, 2018 at 10:48 am

    You can get the ID’s of all the currently logged in users by using this global function: UserInfo.getUserId().

  • Parul

    Member
    September 22, 2018 at 1:07 pm

    You can get the current user id like this.

    UserInfo.getUserId() which returns the user id of the current user.

    For apex Class, you may use and UserInfo.getUserId(), and for a Visualfroce page, you may use {!$User.Id}.

    Hope it helps

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos