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
Julie BachmanJulie Bachman 

Is there way to retrieve AccountID for deleted Contact(available in recycle bin) because I tried using Get<SObjects.Contact>(Helper.SObjectNames.Contact, contactId) for deleted contact and it returned null.

Best Answer chosen by Julie Bachman
Ajay K DubediAjay K Dubedi
Hi Julie,

Yes you can use the simple query below to get list of deleted contacts without indulging in complexity:

List<Contact> conList=[select accountId,name from Contact where isDeleted = true all rows];
system.debug('Deleted Contacts List'+conList);

Hope this will help you.Please mark it as best answer if you find it helpful.

Thanks.
Ajay Dubedi
 

All Answers

Ajay K DubediAjay K Dubedi
Hi Julie,

Yes you can use the simple query below to get list of deleted contacts without indulging in complexity:

List<Contact> conList=[select accountId,name from Contact where isDeleted = true all rows];
system.debug('Deleted Contacts List'+conList);

Hope this will help you.Please mark it as best answer if you find it helpful.

Thanks.
Ajay Dubedi
 
This was selected as the best answer
Sandy JamesSandy James
I think there is no way to do this. 

Sandy@ Broadband Coach (http://broadbandcoach.com/)