SalesforceReader Issue While Reading AnyType Field

Assignee

Reporter

Sprint

Description

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'

 

Steps to reproduce

  1. Enable history tracking on the Opportunity table in Salesforce:

    1. From Setup, click Object Manager and select Opportunity.

    2. Select Fields & Relationships, and click Set History Tracking.

    3. 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.

    4. Save the changes.

  2. Navigate to your Opportunities in Salesforce, select a random opportunity, make a change in the field called 'Probability' in Salesforce and save the changes.

  3. Run the attached graph against the OpportunityFieldHistory table. Make sure to add a working Salesforce connection into the graph.

Attachments

1

Activity

Show:

Jaroslav Urban July 28, 2020 at 10:00 AM
Edited

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.

 

Fixed

Details

Priority

Fix versions

Zendesk ticket

Affects versions

QA Testing

UNDECIDED

Components

Created July 15, 2020 at 8:52 AM
Updated September 12, 2023 at 8:43 AM
Resolved July 17, 2020 at 1:59 PM