+ Start a Discussion
Inanskar007Inanskar007 

Can we delete a single record alone in Recyle bin

Hi Team,
I want to delete single record alone in Recycle bin.. .. I am able to delete all records.. But I want to one delete record out of 10 records in recycle bin. Is  there any way to do it ?

Thanks In Advance
Tarun J.Tarun J.
Hello,

If you have Id for that deleted record, you can delete that record permanently from recycle bin using apex code.
Contact c = new Contact(Id = '0039000000Prvoe');
Database.emptyRecycleBin(c);
Check below link for more details:
https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/apex_methods_system_database.htm#apex_System_Database_emptyRecycleBin_2

-Thanks,
TK
 
jyothsna reddy 5jyothsna reddy 5
Hello,
If you can delete items from Recycle bin using following Apex code:
 
List<Contact> dContactList=[Select ID From Contact Where IsDeleted = true limit 1 ALL ROWS];
Database.emptyRecycleBin( dContactList );

You can run this code in developer console or create a scheduled job in apex.

Thanks,
Jyothsna D
Rashi krishan 1Rashi krishan 1
Hi Tarun,

You can follow either of the following ways to remove a specific recorcd from recycle bin

1) object o = new object(id=' 906F000000090VlIAI');
      Database.emptyRecyclebin(o);
               

                                                                      OR

follow the following link
http://training.handsonconnect.org/m/data/l/36942-how-to-manage-the-recycle-bin

Hope this will help you
Thanks,
Rashi Krishan.
Mirketa Software Pvt Ltd.
http://mirketa.com/index.html