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
MadhanMohan1234MadhanMohan1234 

Query on LoginHistory

When i am Quering "Application ' from the LoginHistory it is showing data but when i am trying put some condition on Application it is not showing some error like.

 

'Application' can not be filtered in query call

 

 

I am trying to do like this :

 

 

SELECT UserId,LoginType,SourceIp,Application,Platform from LoginHistory where LoginType='Application' and Application='Browser'

 May i know whether there is any possibility way of having condition on Application..

Satish_SFDCSatish_SFDC
Some fields in the LoginHistory cannot be filtered.

Id
UserId
LoginTime
LoginType
LoginUrl

More info here:
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_loginhistory.htm

Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.
Satish_SFDCSatish_SFDC
The only fields which can be filtered are mentioned above.

As Application is not in the list, it cannot be used in the filter.

Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.

Satish_SFDCSatish_SFDC
So, i think the other workaround would be this:

SELECT UserId,LoginType,SourceIp,Application,Platform from LoginHistory where LoginType='Application'

Once you get the results, you can then loop through them to find out the records Where Application = 'Browser'.

Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.
MadhanMohan1234MadhanMohan1234

Thanks for your information ,I will try this and let you know.