You need to sign in to do that
Don't have an account?
balaji_sf
Wanted to the retrieve the deleted records
Hi
Is there any way to retrieve the deleted record through API.
I am getting the deleted records ID from the function getDeleted().
and tried to retrieve the record using SOQL , but i can't get it.
Please let me if there is any other way.
Thanks
Balaji
balaji_sf are you using the "QueryAll()" API call when you try to retrieve the delete records? Using the regular "Query()" call won't allow you to retrieve delete records. See the API documentation on the "QueryAll()" API call here:
http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_queryall.htm
All Answers
balaji_sf are you using the "QueryAll()" API call when you try to retrieve the delete records? Using the regular "Query()" call won't allow you to retrieve delete records. See the API documentation on the "QueryAll()" API call here:
http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_queryall.htm
Hi SimonF & apexsutherland
Thanks very much.
I tried the code and its worked very good :smileyhappy:
I had a very old PDF document and i was checking on it and there was no QueryAll information in it
and the module "WWW::Salesforce" which i downloaded from cpan.org too didn't have the function QueryAll(), but i managed to create the function in my own by just replacing the "query" with "queryAll" and it worked fine.
The SOQL is not so intelligent to give me back only the deleted records
as when i tried to give IsDeleted field in where clause i got error.
where i gave "select Id, IsDeleted From Contact where IsDeleted = 'true'"
and got the error
"value of filter criterion for field 'IsDeleted' must be of type boolean and should not be enclosed in quotes at "
If there is any way to filter out only the deleted records please let me know :)
or else i can manage by filtering after getting all the records.
Thanks a lot again.
Regards
Balaji
balaji, you're pretty close, just get rid of the quotes around "true":
SELECT Id, IsDeleted FROM Contact WHERE IsDeleted = TRUE
It worked...
Thank you guys...
Hi Balaji,
I wanted to achieve same functionality of extracting the deleted records using SOQL in Apex. Can you help me in that? How did you achieved this functionality?
I see records in Recycle Bin, but when I query using IsDeleted = TRUE, I get 0 results. Is there any setting I need to turn on? I am querying custom object records.