function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFFSFF 

How can I query the LoginHistory object via SOQL and Apex?

It is sort of available via the user interface, and sort of available via API calls (after v21), and sort of available via reports - but I want to actually query the object directly and drive functionality based on that. Is there any way to do this?

If not, how can I most effectively create and populate a parallel object that allows me to drive this functionality?

 

Thanks!

Jia HuJia Hu
User Apex to query the LoginHistory object, then you can get everyhing you want.
Do you have any special request?
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_loginhistory.htm