You need to sign in to do that
Don't have an account?
Sharankumar Desai
Apex Code to get Logged In users List
Hi All,
I am looking for an Apex code which can get me a list of all current logged In users.
Let me know if this is feasible.
Thanks
Sharan Desai
+91 966 33 11 740
I am looking for an Apex code which can get me a list of all current logged In users.
Let me know if this is feasible.
Thanks
Sharan Desai
+91 966 33 11 740
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_authsession.htm#sforce_api_objects_authsession
So you could query all sessions that aren't considered expired - note that this doesn't mean that they are active. You can access the SOAP API via JavaScript using the Ajax toolkit, so you would be able to get the list of users back to a Visualforce controller and thus into Apex, but you can't access the SOAP api via Apex in a supported fashion.