• Amol Avhad
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I am using data loader from command line to extract data in csv format. I have to hard code the SOQL query everytime in the sfdc.extractionSOQL property. Is there a way to get the field names dynamically and create a query from it? I need to select all fields dynamically and run the SOQL query. Below is the bean, I am using:
<bean id="csvAccountExtractProcess"
      class="com.salesforce.dataloader.process.ProcessRunner"
      singleton="false">
  <description>csvAccountExtract job gets account info from salesforce and saves info into a CSV file."</description>
    <property name="name" value="csvAccountExtract"/>
    <property name="configOverrideMap">
        <map>
            <entry key="sfdc.debugMessages" value="false"/>
            <entry key="sfdc.debugMessagesFile" value="c:\dataloader\samples\status\sfdcSoapTrace.log"/>
            <entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
            <entry key="sfdc.username" value="user@mycompany.com"/>
            <!-- password specified below is invalid, please generate one using the encrypt.bat utility -->
            <entry key="sfdc.password" value="1111111111111111"/>
            <entry key="sfdc.timeoutSecs" value="600"/>
            <entry key="sfdc.loadBatchSize" value="200"/>
            <entry key="sfdc.entity" value="Account"/>
            <entry key="sfdc.extractionRequestSize" value="500"/>
            <entry key="sfdc.extractionSOQL" value="Select Id, Name, Type, ParentId, Phone, AccountNumber, Website, Sic, AnnualRevenue, NumberOfEmployees, TickerSymbol, Oracle_Id__c FROM Account"/>
            <entry key="process.operation" value="extract"/>
            <entry key="process.mappingFile" value="c:\dataloader\samples\conf\accountExtractMap.sdl"/>
            <entry key="dataAccess.type" value="csvWrite"/>
            <entry key="dataAccess.name" value="c:\dataloader\samples\data\extract.csv"/>
        </map>
    </property>
</bean>

 
I am using data loader from command line to extract data in csv format. I have to hard code the SOQL query everytime in the sfdc.extractionSOQL property. Is there a way to get the field names dynamically and create a query from it? I need to select all fields dynamically and run the SOQL query. Below is the bean, I am using:
<bean id="csvAccountExtractProcess"
      class="com.salesforce.dataloader.process.ProcessRunner"
      singleton="false">
  <description>csvAccountExtract job gets account info from salesforce and saves info into a CSV file."</description>
    <property name="name" value="csvAccountExtract"/>
    <property name="configOverrideMap">
        <map>
            <entry key="sfdc.debugMessages" value="false"/>
            <entry key="sfdc.debugMessagesFile" value="c:\dataloader\samples\status\sfdcSoapTrace.log"/>
            <entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
            <entry key="sfdc.username" value="user@mycompany.com"/>
            <!-- password specified below is invalid, please generate one using the encrypt.bat utility -->
            <entry key="sfdc.password" value="1111111111111111"/>
            <entry key="sfdc.timeoutSecs" value="600"/>
            <entry key="sfdc.loadBatchSize" value="200"/>
            <entry key="sfdc.entity" value="Account"/>
            <entry key="sfdc.extractionRequestSize" value="500"/>
            <entry key="sfdc.extractionSOQL" value="Select Id, Name, Type, ParentId, Phone, AccountNumber, Website, Sic, AnnualRevenue, NumberOfEmployees, TickerSymbol, Oracle_Id__c FROM Account"/>
            <entry key="process.operation" value="extract"/>
            <entry key="process.mappingFile" value="c:\dataloader\samples\conf\accountExtractMap.sdl"/>
            <entry key="dataAccess.type" value="csvWrite"/>
            <entry key="dataAccess.name" value="c:\dataloader\samples\data\extract.csv"/>
        </map>
    </property>
</bean>