You need to sign in to do that
Don't have an account?
harsha B R 9
How to find the currently logged in users in the organisation.
Hello Everyone,
Is there any way to find out the currently logged in users of the org.
Requirement :- When a lead is created,I need to assign the lead dynamically to only to the logged in users(Need to fetch all the logged in users of the org programatically).
Salesforce has mentioned in one of the ideas that they have implemented it - https://success.salesforce.com/ideaView?id=08730000000BpPOAA0
Executed the SOQL query - Select a.UsersId, a.IsCurrent, a.UserType, a.SourceIp, a.SessionType, a.SessionSecurityLevel, a.ParentId, a.NumSecondsValid, a.LoginType, a.LastModifiedDate, a.Id, a.CreatedDate From AuthSession a
But,it returned only my user record.It didn't not returned the other users who have logged in the orge.
All the logged in users can be accesed at the UI level --> security controls --> session Management.
Any idea/help is appreicated.
Thanks & Regards,
Harsha BR
Is there any way to find out the currently logged in users of the org.
Requirement :- When a lead is created,I need to assign the lead dynamically to only to the logged in users(Need to fetch all the logged in users of the org programatically).
Salesforce has mentioned in one of the ideas that they have implemented it - https://success.salesforce.com/ideaView?id=08730000000BpPOAA0
Executed the SOQL query - Select a.UsersId, a.IsCurrent, a.UserType, a.SourceIp, a.SessionType, a.SessionSecurityLevel, a.ParentId, a.NumSecondsValid, a.LoginType, a.LastModifiedDate, a.Id, a.CreatedDate From AuthSession a
But,it returned only my user record.It didn't not returned the other users who have logged in the orge.
All the logged in users can be accesed at the UI level --> security controls --> session Management.
Any idea/help is appreicated.
Thanks & Regards,
Harsha BR
You can try following query. test it on developer console first.
Please mark this answer as SOLVED and BEST ANSWER if it helps you.
Regards,
Yogesh More
Salesforce consultant || Salesforce Developer
more.yogesh422@gmail.com || yogeshsfdc11@gmail.com
www.yogeshmore.com || Skype:-yogesh.more44
Salesforce do not ask to Query currently Logged in user, please try with this block of code:
It will provide you the Id of currently logged in user. If you need more fields please visit this link (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_userinfo.htm)
Thanks,
Gaurav
Skype: gaurav62990