Four Stars

Update Salesforce records on a custom object

Hi Community,

 

I´m new in Talend and unfortunately I have some problem with my first job.

 

Here is my scenario:

We use Talend Open Studio. I want to update records in Salesforce on a custom object (for now only in a sandbox to test the talend job). I have an input csv file with the newest data.

 

So here is what I created in talend:

1 - tFileInputDelimited for my source file

2 - tMap, to map the columns in the file and the Salesforce fields

3 - tSalesforceOutput with the user credentials, Module name, Output action (Update) etc.

4 - Two tFileOutputDelimited to create a success and error file. Those two files are not working as I expected, but this is ok for now.

 

The problem is, when I start the job, I got some errors (I think these are errors):

 

Starting job OfflineMarketingOrders at 12:38 09/05/2017.

 

[statistics] connecting to socket on port 3374

[statistics] connected

For input string: "Bol"

For input string: "Vildt og Våben General Flyer 1508""

For input string: "Bol"

For input string: "Sonne"

For input string: "Bol"

For input string: "Sonne"

[statistics] disconnected

Job OfflineMarketingOrders ended at 12:39 09/05/2017. [exit code=0]

 

When I check some of the records in Salesforce, the fields which one should be updated are still empty.

 

I hope someone can give some help with my problem.

 

Thanks and Regards

Csaba

  • Data Integration
  • Sandbox
5 REPLIES
Employee

Re: Update Salesforce records on a custom object

Hi Csaba,

 

You're getting this error because the data in your source file doesn't match the schema definition. So what you need to do is open your schema in the tFileInputDelimited component, and check that the data type and lengths are correct for all your columns.

 

Once you do that, you shouldn't have any error.

 

Regards,

Vinny

Seven Stars TRF
Seven Stars

Re: Update Salesforce records on a custom object

To complete what @vgalopin said, if you don't have any calculation to do, just keep all fields as string datatype. In fact, the flow will be carried as plain text and Salesforce will assume the required conversion for you.

TRF
Four Stars

Re: Update Salesforce records on a custom object

Hey guys,

 

thanks for your responses.

Well, the data types are correct, but not the field length. 

I will make the changes and start a test run today afternoon.

 

KR

Csaba

Four Stars

Re: Update Salesforce records on a custom object

Hey guys,

 

I make the changes in the field type. So each field in my input file have string as type.

But now I get another error:

tarting job OfflineMarketingOrders_2 at 10:09 15/05/2017.

[statistics] connecting to socket on port 3979
[statistics] connected
Exception in component tSalesforceOutput_1
java.lang.NumberFormatException
	at java.math.BigDecimal.<init>(Unknown Source)
	at java.math.BigDecimal.<init>(Unknown Source)
	at java.math.BigDecimal.<init>(Unknown Source)
	at org.talend.components.salesforce.runtime.SalesforceAvroRegistry$StringToDecimalConverter.convertToAvro(SalesforceAvroRegistry.java:280)
	at org.talend.components.salesforce.runtime.SalesforceAvroRegistry$StringToDecimalConverter.convertToAvro(SalesforceAvroRegistry.java:272)
	at org.talend.components.salesforce.runtime.SalesforceWriter.addSObjectField(SalesforceWriter.java:268)
	at org.talend.components.salesforce.runtime.SalesforceWriter.createSObjectForUpsert(SalesforceWriter.java:210)
	at org.talend.components.salesforce.runtime.SalesforceWriter.doUpsert(SalesforceWriter.java:370)
	at org.talend.components.salesforce.runtime.SalesforceWriter.upsert(SalesforceWriter.java:359)
	at org.talend.components.salesforce.runtime.SalesforceWriter.write(SalesforceWriter.java:163)
	at marketing.offlinemarketingorders_2_0_1.OfflineMarketingOrders_2.tFileInputDelimited_1Process(OfflineMarketingOrders_2.java:2157)
[statistics] disconnected
	at marketing.offlinemarketingorders_2_0_1.OfflineMarketingOrders_2.runJobInTOS(OfflineMarketingOrders_2.java:3215)
	at marketing.offlinemarketingorders_2_0_1.OfflineMarketingOrders_2.main(OfflineMarketingOrders_2.java:3072)
Job OfflineMarketingOrders_2 ended at 10:09 15/05/2017. [exit code=1]

I tried the following steps:

  • Change the field types in BigDecimal, don´t work
  • Change the length of the decimal places in SF and in Talend,  don´t work

Do you have any tips for me?

 

Thanks and regards

Csaba

Seven Stars TRF
Seven Stars

Re: Update Salesforce records on a custom object

Right, you change datatypes in the tFileInputDelimied schema, but do you change also in tSalesforceOutput component?

Also, depending on your data, you should change decimal point from comma (,) to point (.) as expected by Salesforce API.


TRF