• #15767
    Salesforce | Tanu Tanu #226

    Profile name from LoginHistory using SOQL

    Hii All,
    I have a requirement where i need to get the total count of Logins done by the particular profile.


    Salesforce | Mohit Mohit #140

    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);


Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?