Activity Forums Salesforce® Discussions Is there any SOQL statement that we can used to get all records even from recycle bin or Achieved Activities in Salesforce?if yes then what is the statement?

  • Manpreet

    Member
    April 11, 2017 at 4:57 am

    Hi saurabh,

    Simply use the ALL ROWS clause.

    SELECT Id, isDeleted FROM <Oblectname> WHERE isDeleted = true All ROWS - This will only return the deleted rows.
    SELECT Id, isDeleted FROM <Oblectname> WHERE isArchived = true All ROWS - This will only return the archived rows.
    SELECT Id, isDeleted FROM <Oblectname> All ROWS - This will return the deleted records, archived records and records that are neither deleted nor archived (data set identical to the one returned by a SOQL not using ALL ROWS) as well.

    You can-not use ALL ROWS and FOR UPDATE together.

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Salesforce Integration Tutorial | Integrate Salesforce with Apps

Video in

This "𝐒𝐚𝐥𝐞𝐬𝐟𝐨𝐫𝐜𝐞 𝐈𝐧𝐭𝐞𝐠𝐫𝐚𝐭𝐢𝐨𝐧 𝐓𝐮𝐭𝐨𝐫𝐢𝐚𝐥" video by Edureka will help you understand what is Salesforce integration in detail. It will also address the various Salesforce integration…