Activity Forums Salesforce® Discussions Which SOQL statement in salesforce that can be used to get all records?

  • Piyush

    Member
    August 23, 2019 at 3:56 am

    Hi Prachi,

    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