I want to query deleted records in Salesforce and retrieve the LastModifiedDate of these records.

My query:

"Select LastModifiedDate FROM Custom_Table__c WHERE  customFields = '456_0_1' ALL ROWS"

But i'm getting this error:

java.io.IOException: [MalformedQueryFault [ApiQueryFault [ApiFault  exceptionCode='MALFORMED_QUERY'
 customFields = '456_0_1' ALL ROWS
ERROR at Row:1:Column:111
unexpected token: 'ALL ROWS'

What's wrong?

  • 1
    Did you try escaping '456_0_1' as \'456_0_1\'? – Shailesh Patil Feb 26 '18 at 12:23

You are getting this error because ALL ROWS is only allowed with SOQL inside of APEX code, so this is not going to work.

But since you are using talend, this is done easily by executing the following query and checking the "Include deleted records" checkbox as shown below:

enter image description here

hope it helps.

  • Thanks a lot, this worked. I have to use the component's feature. – OiRc Feb 26 '18 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.