Skip to content


Writing to SalesForce System.DateTime and System.Double Fields from SQL via Smart Connect

don4g asked 9 years ago

I am using the SalesForce Connector to push data from MS SQL into SalesForce.

When I try to push into a SalesForce System.DateTime field the Map will fail when I run it. Also, when I try to push into a SalesForce System.Double field the Map will run successfully but not actually push the data into SalesForce. 

Has anyone else seen this issues, if so please provide some information on how to work around. 


kevin replied 9 years ago

SalesForce Dates
When sending dates to SalesForce I use yyyy-MM-dd as the format for the date. To format a date either use a calculated or date field in the SmartConnect mapping area.

Calculation column:
         return DateTime.Now.ToString("yyyy-MM-dd") for the current date or
         return Convert.ToDateTime(<date_field>).ToString("yyyy-MM-dd")
         return DateTime.Now.ToString("yyyy-MM-dd"); for the current date or 
         return Convert.ToDateTime(<date_field>).ToString("yyyy-MM-dd");
Date column:
         source data : the column that contains the date
         source format: the format of the source date
         target format : select Long year, month, day format

System.Double fields
I have not had any issues sending data to double fields, and the only way I can find to get an error with this is to pass in a numeric value that is too large for the field (decimal places dont seem to count, extra decimal places are ignored). Check that the number is the right size for the double field you are updating


Dominic Pries replied 3 years ago

Resurrecting an old post…Kevin, I don’t think you answered don4g’s question. He was asking about datetime, not date. How does SmarConnect convert a datetime field in sql server to a datetime field in Salesforce, which requires the timezone component??

Patrick Roth Staff replied 3 years ago

In short, the answer isn’t that SC doesn’t format the datetime field – you do.
In the end, you are sending over the string, int, datetime fields, and you format those however you want (hopefully correctly).

So when reading the data from wherever it comes from (SQL Query in this initial example) the data is a “date” and not a “string” at that point (depends on how is read and from what source).

So you’d just need to format the output to SF to how SF wants it.

Ethan talks about the SF date & datetime formats here:

If you would like to submit an answer or comment, please sign in to the eOne portal.