Skip to main content
Hi guys,

I'm trying to filter a SOQL query on the LoginHistory object using the Application field. Apprrently, this is not possible since 'Application' is not filterable (curious as to why that is.) I'm wondering if there is any workaround to this limitation, assuming I need to filter the information in Application to achieve my goal.

Thanks!
2 个回答
  1. 2019年5月29日 06:05
    @Yissochor Eisenberg

    There are three other objects: LoginEvent, LoginGeo and LoginIp.

    But the field Application is never filterable par SOQL.

    So the only trivial workarounds are the export of the login history (csv+java./python) ( Setup > Login History ) or to use a filter on another field like the logintime.

    select id, userid, logintime, application from loginhistory where logintime = THIS_MONTH

    A batch can also read the LoginHistory object regularly and load a new custom object where the new field Application__c is now filterable (or by using dataloader reloading the exported csv file).

     
0/9000