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