Activity Forums Salesforce® Discussions How to get all Salesforce records even from recycle bin or Achieved Activities using SOQL query?

  • Suraj

    Member
    May 15, 2017 at 1:59 pm

    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.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos