7

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!

2 Answers 2

8

you have to query LoginHistory object. I just tried to execute this from 'Developer Console' and works nicely

system.debug([SELECT ApiType,ApiVersion,Application,Browser,ClientVersion,Id,LoginTime,LoginType,LoginUrl,Platform,SourceIp,Status,UserId FROM LoginHistory limit 12]);
3
  • Thanks! For some reason, querying LoginHistory wasn't working from the Force.com Explorer ...
    – user735
    Commented Dec 27, 2012 at 4:18
  • 1
    I just tried to execute this from 'Developer Console' and works nicely Commented Dec 27, 2012 at 4:38
  • 1
    You would need to be using API version 21.0 or higher to access the LoginHistory records as it was introduced in the Spring '11 release. Commented Dec 27, 2012 at 6:44
4

Go through Login History Object

You must log in to answer this question.