Activity Forums Salesforce® Discussions Profile name from LoginHistory using SOQL

  • Mohit

    Member
    September 2, 2016 at 5:34 am

    Hi Tanu,

    You can get the total count of login done by a profile by this SOQL query:-
    List<User> userid =[Select id from user where Name = 'Profile Name' limit 1];
    Integer count = [select count() from LoginHistory where id =: userid[0].id ];
    System.debug('The total count of login'+count);

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos