• Nidhi Sharma
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies

Hi,

 

I would like to use dynamic query from Data Loader batch mode to extract only data that is changed since last run. Is there any way to achieve that by configuring in process-conf.xml file ?

 

Here is example:

Select Id, Name FROM Account where lastModifiedDate > @process.lastRunDate@

 

I found couple of posts that recommend using @process.lastRunDate@, but it does not work in my case.

 

Any help would be appreciated.

 

thanks!

I'm new to visualforce/apex so there's probably something fundamental I'm not getting about how VF pages work, but how do I access XML data from within a visualforce page? More specifically, how do I use XML data to generate tables and other elements on a page?

 

For example, I'm trying to query a remote site for a given person using an id stored in the salesforce database, this remote site returns XML data about this person, including activities this person performed on the remote site -- i.e.:

 

<xml...>
<Person>
<Id>123</Id>
<Name>John Doe</Name>
<Email>jdoe@example.com</Email>
<Activities>
<Activity>
<Title>Ate a pie</Title>
<Date>2010-01-20 14:26:12 -05:00</Date>
<Url>http://www.example.com/pie</Url>
</Activity>
<Activity>
<Title>Baked a cake</Title>
<Date>2010-01-20 14:26:12 -05:00</Date>
<Url>http://www.example.com/cake</Url>
</Activity>
</Activities>
</Person>

 

 I can load this fine in Apex and parse it with XMLDom, then access the various fields using getElementsByTagName(), getValue(), etc. But how do I display this data on a visualforce page? I've tried saving the 'Person' XMLDom.Element node as a property in a controller class, but can't seem to access any of the sub-elements... i.e.:

 

public class MyActivities {

public XMLDom.Element person { get; set; }

public MyActivities(...) {
String xml = GetRemoteXML();
String dom = new XMLDom(xml);

person = dom.getElementByName('Person');
}
}

 

Using:

 

<b>{!person}</b>

 

 Gets me ... "core.apexpages.el.adapters.ApexObjectValueELAdapter@226dc1" (displayed in the VF page) ... which I assume points to the XMLDom.Element object. (I don't get an error at least...)

 

 But if I try to do any of the following, I get errors:

 

<b>{!person.name}</b>

<b>{!person.Name}</b>
<b>{!person['name']}</b>
<b>{!person.getValue('name')}</b>
<b>{!person.attributes.name}</b>
<b>{!person.attributes['name']}</b>

 

 

I've also tried mapping the XML data to a Map<String,String> property in my controller class:

public Map<String,String> person_map { get; set;}

...

person_map.put('name', dom.getValue('Name'));

 

But again, in visualforce, I can't figure out how to traverse *into* the map (i.e. {!person_map.Name}, {!person_map['Name']}, {!person_map.get('Name')}, etc.)

 

Eventually I'd really like to be able to do an <apex: pageBlockTable> around the Activity entries, but if I can't even get to the Name entry, I'm not sure how I would get to something lower down in the XML structure.

 

 

I've looked around for examples like this... for examples on using XML data to populate a page and on accessing Maps and other compound elements but didn't find anything helpful.

 

Everything seems to be based on specific sObjects (Leads, Accounts, Some_Custom_Object__c, etc.) or on scalar controller class properties. Obviously, I don't want to go in and create a whole new '__c' custom object in salesforce just to map and hold this XML data.... I just want to read it from the remote site and display it, I don't need to store it in salesforce.

 

Have I missed the examples on how to do this?

 

Thanks,

 

---Lawrence

 

 

 

I've been having a big issue getting the Apex data loader to run via the command line. I'm using v14.

I've encrypted the password correctly:
Code:
encrypt -e passwordSecurityToken

 The results I store in the conf file, which looks like this:
Code:
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="csvLenderExtractProcess"
          class="com.salesforce.lexiloader.process.ProcessRunner"
          singleton="false">
      <description>csvLenderExtract job gets account info from salesforce and saves info into a CSV file."</description>
        <property name="name" value="csvLenderExtract"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="false"/>
                <entry key="sfdc.debugMessagesFile" value="c:\Program Files\salesforce.com\Apex Data Loader 14.0\sfdcSoapTrace.log"/>
                <entry key="sfdc.endpoint" value="https://www.salesforce.com"/>
                <entry key="sfdc.username" value="user@customer.com"/>
                <!-- password specified below is invalid, please generate one using the encrypt.bat utility -->
                <entry key="sfdc.password" value="a58afc521f2f0f6a1f26adab1e6dbc740d705a086f9301310754ec6f9753d7d0" />
  <entry key="process.encryptionKeyFile" value="c:\Program Files\salesforce.com\Apex Data Loader 14.0\conf\password.key" />
                <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 FROM Account"/>
                <entry key="process.operation" value="extract"/>
                <entry key="process.mappingFile" value="C:\Program Files\salesforce.com\Apex Data Loader 14.0\conf\accountExtractMap.sdl"/>
                <entry key="dataAccess.type" value="csvWrite"/>
                <entry key="dataAccess.name" value="C:\Program Files\salesforce.com\Apex Data Loader 14.0\data\extractLender.csv"/>
            </map>
        </property>
    </bean>
</beans>

 If I leave the sfdc.password entry in the xml it complains it's an invalid string. If I comment it out to just use the password file, I get:
Code:
1232 [csvLenderExtract] ERROR com.salesforce.lexiloader.process.ProcessRunner  -
 Invalid username, password, security token; or user locked out.                
Exception in thread "main" java.lang.RuntimeException: [LoginFault [ApiFault  ex
ceptionCode='INVALID_LOGIN'                                                     
 exceptionMessage='Invalid username, password, security token; or user locked ou
t.'                                                                             
]                                                                               
]                                                                               
                                                                                
        at com.salesforce.lexiloader.process.ProcessRunner.run(ProcessRunner.jav
a:148)                                                                          
        at com.salesforce.lexiloader.process.ProcessRunner.main(ProcessRunner.ja
va:228)                                                                         
Caused by: [LoginFault [ApiFault  exceptionCode='INVALID_LOGIN'                 
 exceptionMessage='Invalid username, password, security token; or user locked ou
t.'                                                                             
]                                                                               
]                                                                               
                                                                                
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                                                                                
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)                                                         
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)                                                 
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)      
        at java.lang.Class.newInstance0(Class.java:350)                         
        at java.lang.Class.newInstance(Class.java:303)                          
        at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:563)        
        at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:475)        
        at com.sforce.ws.transport.SoapConnection.parseDetail(SoapConnection.jav
a:187)                                                                          
        at com.sforce.ws.transport.SoapConnection.createException(SoapConnection
.java:166)                                                                      
        at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:11
2)                                                                              
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:92)  
        at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.jav
a:864)                                                                          
        at com.salesforce.lexiloader.client.PartnerClient.connectImpl(PartnerCli
ent.java:169)                                                                   
        at com.salesforce.lexiloader.client.PartnerClient.connect(PartnerClient.
java:148)                                                                       
        at com.salesforce.lexiloader.controller.Controller.login(Controller.java
:174)                                                                           
        at com.salesforce.lexiloader.process.ProcessRunner.run(ProcessRunner.jav
a:115)                                                                          
        ... 1 more                                                              

 
Does v14.0 even work via the command line?

Thanks in advance.