3

I'm using ant to operate auto data loader with the CLI.

The dates that I load are uploading with one day back. I set a variable that get the GMT value but still it isnt working

Here is my process-conf.xml

    class="com.salesforce.dataloader.process.ProcessRunner"
    singleton="false">
    <description>Inserts object records from a CSV file.</description>
    <property name="name" value="Deal__cUpsert"/>
    <property name="configOverrideMap">
        <map>
            <entry key="sfdc.endpoint" value="https://eu6.salesforce.com"/>
            <entry key="sfdc.username" value="xxxxxxx"/>
            <entry key="sfdc.password" value="xxxxxxxxxxx"/>
            <entry key="process.encryptionKeyFile" value="C:\Users\alon\Documents\Data Load/datascripts/dataloader_encryption_key.txt"/>
            <entry key="sfdc.debugMessages" value="true"/>
            <entry key="sfdc.debugMessagesFile" value="C:\Users\alon\Documents\Data Load/orgs/Ampa Capital/data/debug.log"/>
            <entry key="sfdc.timeoutSecs" value="600"/>
            <entry key="sfdc.loadBatchSize" value="50"/>
                <entry key="sfdc.externalIdField" value="External_Id__c"/>
            <entry key="process.operation" value="upsert"/>
            <entry key="dataAccess.type" value="csvRead"/>
            <entry key="sfdc.entity" value="Deal__c"/>
            <entry key="dataAccess.name" value="C:\Users\alon\Documents\Data Load/datascripts/datafiles/EquipTradeImport.csv"/>
            <entry key="process.mappingFile" value="C:\Users\alon\Documents\Data Load/datascripts/mappingfiles/EquipTradeImportMap.sdl"/>
            <entry key="process.outputSuccess" value="C:\Users\alon\Documents\Data Load/orgs/Ampa Capital/data/Deal__cEquipTradeImport_success.csv"/>
            <entry key="process.outputError" value="C:\Users\alon\Documents\Data Load/orgs/Ampa Capital/data/Deal__cEquipTradeImport_error.csv"/>
            <entry key="sfdc.timeZone" value="GMT"/>
            <entry key="process.useEuropeanDates" value="true"/>


        </map>
    </property>
</bean>

Thanks

  • What time zone is the CSV data in that you're loading? Is it in local time or GMT? Is your Org ahead of GMT or behind in terms of hours? – crmprogdev Dec 11 '16 at 19:57
2

As you have correctly guessed the timezone is an issue.

It is best to format date values in your CSV file such that they include both time and timezone, to make it independent of your computer timezone and SFDC Org default timezone.

From the documentation: https://help.salesforce.com/articleView?id=000004680&language=en_US&type=1

Example scenarios

Scenario: If your org's time zone is set as "China/Taiwan time zone GMT+8":

"Date" and Data Loader time zone is GMT+0, GMT, or blank

Your example data in your import spreadsheet can be either:

2011-01-10
2011-01-10 00:00:00
2011-01-10T00:00:00Z
2011-01-10T00:00:00.000Z

"Date" and Data Loader time zone is GMT+8

Your example data in your import spreadsheet must be either:
2011-01-10 08:00:00
2011-01-10T08:00:00Z
2011-01-10T08:00:00.000Z

Note: If you set the hh:mm:ss to 00:00:00, the Import Date data in Salesforce will display the previous day ('2011-01-09' instead of '2011-01-10').

You will find more details and examples by the link I mentioned above.

1

Data Loader CLI can be affected by three timezones:

  1. SFDC timezone
  2. local machine timezone
  3. JDBC source database timezone

We had the issue of it reverting to the local machine user timezone. This issue causes validation errors especially on date fields such as Lead.ConvertedDate falling over to a previous calendar day - in this case the sfdc.timezone parameter had no effect.

In Apache Ant, we had to take two steps:

  • explicitly fork the java process
  • overload the running context timezone using jvmarg parameter

    <java fork="true" classname="com.salesforce.dataloader.process.ProcessRunner" classpath="...">
        <arg line="process.name=execute" />
        <jvmarg value="-Duser.timezone=GMT" />
        <sysproperty key="salesforce.config.dir" value="..." />
    </java>
    

This solution can be committed into the build script as a permanent fix.

0

I had the same problem and I solved it with this:

I think it was just "sfdc.timezone" instead of "sfdc.timeZone", as you can see in the Dataloader Guide, page 28.

http://resources.docs.salesforce.com/198/10/en-us/sfdc/pdf/salesforce_data_loader.pdf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.