function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
EIE50EIE50 

Query or export items in recycle bin

Hi,

 

I was just wondering, is there a way to query to the items in the recycle bin in our organization. If so, any samples are appreciated.

 

Also, Can i export items out of recycle bin using a data loader?? Any stpes regarding the same would be appreciated.

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
NevilNevil

Might be this is too late...but here is the answer

 

Regarding Quering reclycle bin - yes we can do that using All Rows keyword.

For Example : for quering deleted reports we can write a qury like this - [Select Id, Name FROM Report WHERE IsDeleted = True ALL ROWS]

 

Regading Quering recyle bin recods via data loader - you need to select Export All option, then it will give you both deleted and existing record. If you want records only from recycle bin just add one condition "IsDeleted = True"

All Answers

*werewolf**werewolf*

To query items that are in the recycle bin, just construct a query on any object where IsDeleted=1.  I'm not sure about the Data Loader though, I think it ignores deleted items by default.

EIE50EIE50

Hi,

 

Thanks for the reply.

 

In Eclipse IDE, for some reason the IsDeleted = 1 is not being considered by eclipse, instead if i give IsDeleted = true, then it is working fine without errors, though it is not returning me the deleted items which are in the recycle bin. Thanks for the pointer though.

 

In data loader, even though i add the filter condition of IsDeleted = true, it is not returning me any records.

 

In both the above cases, there are no records being returned. Am i missing something? or this query would not work in eclipse or data loader alone.

 

Thanks.

NevilNevil

Might be this is too late...but here is the answer

 

Regarding Quering reclycle bin - yes we can do that using All Rows keyword.

For Example : for quering deleted reports we can write a qury like this - [Select Id, Name FROM Report WHERE IsDeleted = True ALL ROWS]

 

Regading Quering recyle bin recods via data loader - you need to select Export All option, then it will give you both deleted and existing record. If you want records only from recycle bin just add one condition "IsDeleted = True"

This was selected as the best answer
john s.john s.
Hello Is it possible to query opportunity  records which are has related items in the recycle bin 

regards john