AnsweredAssumed Answered

Salesforce Input - ArrayIndexOutOfBoundsException when retrieving Deleted records

Question asked by Ingo Levin on Jun 14, 2018

Hi, I had raised a JIRA for this ages ago and was wondering if someone else has experienced the same problem.

 

I want to retrieve all the Deleted records for a given Salesforce object. The Salesforce Input step supports three Retrieval options: All, Updated, Deleted. The prior two work fine, but trying to get the Deleted records always throws the below error for me.

 

Steps to reproduce:

  • Create a blank Transformation and add the Salesforce input step
    • Settings:
      • Enter Username/password
      • Module: Account
    • Content
      • Retrieve: Deleted
      • StartDate: select some date via the date picker < 30 days in the past
      • EndDate: select today's date/time
    • Fields:
      • Add one return field "Id" type String
  • Save the Transformation
  • Preview the Salesforce Input step
2018/06/14 14:47:03 - Salesforce Input.0 - ERROR (version 8.1.0.0-365, build 8.1.0.0-365 from 2018-04-30 09.42.24 by buildguy) : org.pentaho.di.core.exception.KettleException: 
2018/06/14 14:47:03 - Salesforce Input.0 - Can not read data from Salesforce!
2018/06/14 14:47:03 - Salesforce Input.0 - 62
2018/06/14 14:47:03 - Salesforce Input.0 - 
2018/06/14 14:47:03 - Salesforce Input.0 - at org.pentaho.di.trans.steps.salesforceinput.SalesforceInput.getOneRow(SalesforceInput.java:263)
2018/06/14 14:47:03 - Salesforce Input.0 - at org.pentaho.di.trans.steps.salesforceinput.SalesforceInput.processRow(SalesforceInput.java:97)
2018/06/14 14:47:03 - Salesforce Input.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2018/06/14 14:47:03 - Salesforce Input.0 - at java.lang.Thread.run(Unknown Source)
2018/06/14 14:47:03 - Salesforce Input.0 - Caused by: java.lang.ArrayIndexOutOfBoundsException: 62
2018/06/14 14:47:03 - Salesforce Input.0 - at org.pentaho.di.trans.steps.salesforce.SalesforceConnection.getRecord(SalesforceConnection.java:568)
2018/06/14 14:47:03 - Salesforce Input.0 - at org.pentaho.di.trans.steps.salesforceinput.SalesforceInput.getOneRow(SalesforceInput.java:184)

 

My hunch is that the issue lies in the fact that the GetDeleted API call from Salesforce returns two fixed properties only (Id, DeletedDate), while the other two retrieval options (All, Updated) return the actual record with the full set of field (Id, Name, etc)

 

Would appreciate if anyone could help with this!

Outcomes