function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC Developer1SFDC Developer1 

Import attachments using command line interface(CLI)

I want to import images to a custom object using command line interface.I have a custom object so I want to add those images in attachment of that custom object.I have a process-conf file and mapping file ready and I am also giving parent id of my custom object in my csv file but still i am getting errors.If i try to do this using data loader with same mapping then all the images are adding successfully. Please help.

Process-config file

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans> 
    <bean id="InsertAttachmentProcess"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
        <description>Insert process for images</description>
        <property name="name" value="InsertAttachmentProcess"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.endpoint" value="https://--nsalasDev.cs32.my.salesforce.com"/> 
                <entry key="process.encryptionKeyFile" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\dataLoader.key"/>
                <entry key="sfdc.username" value="test@abc.com"/>
                <!-- password below has been encrypted using key file, therefore it will not work without the key setting: process.encryptionKeyFile
                the password is not a valid encrypted value, please generate the real value using encrypt.bat utility -->
                <entry key="sfdc.password" value="9d41a00cca60d364b0960b9e8970c34a46a2d1d08992306082bd0d249d4e74122d6526e"/>                
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>                
                <entry key="sfdc.entity" value="Attachment"/>
                <entry key="process.operation" value="insert"/>
                <entry key="process.mappingFile" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\Attachments.sdl"/>
                <entry key="dataAccess.name" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\ImportFile.csv"/>
                <entry key="dataAccess.type" value="csvRead"/>
                <entry key="process.initialLastRunDate" value="2006-12-01T00:00:00.000-0800"/>
                <entry key="process.enableExtractStatusOutput" value="true" />
                <entry key="process.outputSuccess" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\InsertSuccess.csv"/>
                <entry key="process.outputError" value="C:\Users\nsale\Data_Loader_Dev\Data_Loader_Attachments\InsertError.csv"/>
            </map>
        </property>
    </bean>
</beans>

Mapping file-

Parent ID=ParentId
Name=Name
Path=Body
Description=Description

Error I am getting-

Mapping for field Parent ID will be ignored since destination column is empty

Error message:Required fields are missing: [ParentId]