0

I am currently using a powershell script to run a data loader command line insert job. The process appears to run correctly, and shows all records successfully inserted. However, when referenced in salesforce, the created record has all blank fields, except for the name, which is set to its salesforce ID. Moreover, when I try to insert records with invalid fields, they are still reported as successfully inserted, with the same result.

If I do the same operation in the data loader UI, using the same input CSV and mapping file, the records are successfully inserted and records with invalid fields are rejected.

Here is my process-conf.xml file (with some fields redacted):

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="orgPreferenceInsert"
      class="com.salesforce.dataloader.process.ProcessRunner"
      singleton="false">
        <description>{description} </description>
        <property name="name" value="orgPreferenceInsert"/>
        <property name="configOverrideMap">
            <map>
                <entry key="process.operation" value="insert"/>
                <entry key="sfdc.username" value="{username}" />
                <entry key="sfdc.password" value="{password}" />
                <entry key="process.encryptionKeyFile" value="{key file}" />
                <entry key="sfdc.entity" value="{field name}"/>
                <entry key="sfdc.externalIdField" value="Id" />
                <entry key="process.mappingFile" value="{mapping file}"/>
                <entry key="process.outputError" value="{output error file}" />
                <entry key="process.outputSuccess" value="{output success file}" />
                <entry key="dataAccess.name" value="{input csv file}"/>
                <entry key="dataAccess.type" value="csvRead"/>
            </map>
        </property>
    </bean>
</beans>

Here is the config.properties file:

#Loader Config
#Thu Sep 10 09:37:47 PDT 2009
sfdc.endpoint=https://test.salesforce.com

sfdc.loadBatchSize=200
sfdc.timeoutSecs=540
sfdc.timezone=PDT
sfdc.debugMessages=false
sfdc.debugMessagesFile={debug file path}
  • Can you also post your mapping file that you are using for CLI? Also are you running the CLI and UI both with the same user/profile combination? – Jayant Das Aug 27 '18 at 17:57
  • @JayantDas the CLI and UI are using the same login. I don't think I'm able to post the mapping file for security reasons--is there a specific issue I should be looking for with that? – Fischer Jemison Aug 27 '18 at 18:05
  • You may like to verify if you have the right mapping in there for all the fields that you expect to be loaded. – Jayant Das Aug 27 '18 at 18:06
  • I've run the insert successfully through the UI using the same mapping so I suspect it's working, unless there's a reason it might work on one but not the other. – Fischer Jemison Aug 27 '18 at 18:12
  • Unfortunately, without really looking at the mapping file and the sdl file, it will be difficult to provide any clue here. You may like to check any validation rules, etc. if there's something that lets you to insert a record using UI vs. CLI. – Jayant Das Aug 27 '18 at 18:16
1

Going to answer my own question since I solved the problem today. It turns out that, in the CLI, mapping files are case sensitive, while in the UI they are not. I also suspect that the CLI allows non-case-matching fields to validate on the client side, while they fail as part of the insertion operation. Thus, if there is a case mismatch between the field in your mapping file and the field name as created in Salesforce, the upload will succeed but no data will be inserted. The fix was simply to change the mapping file so that the cases matched.

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.