SalesforceReader Issue While Reading AnyType Field
Assignee

Reporter

Labels
Sprint
Description
Steps to reproduce
Enable history tracking on the Opportunity table in Salesforce:
From Setup, click Object Manager and select Opportunity.
Select Fields & Relationships, and click Set History Tracking.
In the 'Track old and new values' section, select some of the fields you would like to track. Make sure to select the 'Probability' field.
Save the changes.
Navigate to your Opportunities in Salesforce, select a random opportunity, make a change in the field called 'Probability' in Salesforce and save the changes.
Run the attached graph against the OpportunityFieldHistory table. Make sure to add a working Salesforce connection into the graph.
Attachments
Activity

Jaroslav Urban July 28, 2020 at 10:00 AMEdited
Closing:
tested the attached graph manually (in latest release build), works OK
disabled history tracking again
code review

Pavel Salamon July 17, 2020 at 1:43 PM
Observed API behavior when debugging:
The currency type read from anyType field comes in as java String - e.g. "1000.3"
The percent type read from anyType field comes in as java Double - e.g. 80.0
The exception was thrown because our StringDataField can't be filled by java Double.
Solved in SalesforceReader component - when filling to clover String field, the values are converted using toString().

Pavel Salamon July 15, 2020 at 11:00 AM
Notes from when we were looking into it:
SF field anyType produces clover string field in the internal metadata (correct)
When the anyType field actually contained SF type currency, it worked
When the anyType field actually contained SF type percent, it didn't work
It's unclear why value "80.0" couldn't be set to the internal clover string field.
The two fields mentioned above were Amount (type currency) and Probability (type percent) from object Opportunity.
But they were being read from field NewValue (type anyType) from object OpportunityFieldHistory.
SalesforceReader can encounter the following error when reading a field of type "anyType":
String field "NewValue" can not be set to value 80.0 in field 6 ("NewValue"); value: '80.0'