Activity Forums Salesforce® Discussions How to query recently viewed records of a particular Salesforce sobject?

  • Aman

    Member
    May 1, 2018 at 8:31 am

    Hi Rajan,

    You can use the below query :

    [SELECT Id,Name FROM RecentlyViewed WHERE Type = 'et4ae5__IndividualEmailResult__c' ];

    Thanks

  • PRANAV

    Member
    May 1, 2018 at 9:30 am

    Hi Rajan

    You can use the below SOQL query:

    SELECT Id, Name, Type, LastViewedDate
    FROM RecentlyViewed
    WHERE LastViewedDate !=null AND Type = 'Account'
    ORDER BY LastViewedDate DESC

    Here you can use different TYPE for particular sObject.

    Hope this helps you more.

  • shariq

    Member
    September 20, 2018 at 6:42 pm

    Hi,

    Try this -

    SELECT Id, 
    FROM RecentlyViewed
    WHERE  Type = ‘sobject__c’
    ORDER BY LastViewedDate DESC Limit 50000

    Hope this helps.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos