• Chandra Sfd
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
I would like to schedule command line data loader every month to extract EmailMessages that were created last year current month. Could you please provide your inputs on how to write the SOQL to do this? Thank you!
Hi all, I am using command line data loader to upsert records into a custom object and I have scheduled it using windows scheduler. As an admin, I would like to recieve the error logs, if any, as an email attachment. If getting error log as an email attachment is not possible, I would atleast like to be notified when there are any errors during the upsert process. Please provide your inputs. Thank you!
I would like to schedule command line data loader every month to extract EmailMessages that were created last year current month. Could you please provide your inputs on how to write the SOQL to do this? Thank you!
Hi all, I am using command line data loader to upsert records into a custom object and I have scheduled it using windows scheduler. As an admin, I would like to recieve the error logs, if any, as an email attachment. If getting error log as an email attachment is not possible, I would atleast like to be notified when there are any errors during the upsert process. Please provide your inputs. Thank you!

Hi,

 

 

 

 

I need to get all those records which were created in 'This month of Last Year'.  Since this is November 2012, I need to get all the records created in November last year in SOQL query.  I run this query on the 1st of every month.   Is there any exact date literal ?  Can I compare the months or something like that ?

 

I have checked Data Literals, I found LAST_N_DAYS:n .  I used it to build the following query ( which I do not like it)

 

SELECT Id FROM Account WHERE CreatedDate <= LAST_N_DAYS:365  && CreatedDate >= LAST_N_DAYS:335 

(365-335 =30 days difference, 1 month difference)

 

The query gives incorrect results and is not perfect as the query picks 30 days difference every month which is wrong. If I go with this, I need to calculate for 31 days as well and have to consider leap years and all which is hectic.

 

Any simple Ideas please?

 

Hello All,

 

We can share a file posted on the chatter using GUI to a user , I am trying to achive the same in apex but not getting which object stores that information . ContentVersion is the object stores file but where how the sharing is stored ?

 

Regards,

Atul

Iam trying to export data from Oracle to SFDC using Command Line .

Iam finding the below error.

ERROR [testProcess] database.DatabaseContext initConnection (DatabaseContext.java:94) - Database error encountered during connecting for database configuration: queryAccount.  Sql error: Cannot create PoolableConnectionFactory (Io exception: The Network Adapter could not establish the connection).
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Io exception: The Network Adapter could not establish the connection)

PLease find the entire error log,process-conf,database-conf as below.

Your help is highly appreciated.

2007-08-29 09:56:40,722 INFO  [main] controller.Controller initLog (Controller.java:382) - The log has been initialized
2007-08-29 09:56:40,722 INFO  [main] process.ProcessConfig getBeanFactory (ProcessConfig.java:78) - Loading process configuration from config file: c:\test\process-conf.xml
2007-08-29 09:56:40,784 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions from file [c:\test_hms\process-conf.xml]
2007-08-29 09:56:40,816 INFO  [main] core.CollectionFactory <clinit> (CollectionFactory.java:66) - JDK 1.4+ collections available
2007-08-29 09:56:40,816 INFO  [main] core.CollectionFactory <clinit> (CollectionFactory.java:71) - Commons Collections 3.x available
2007-08-29 09:56:40,878 INFO  [testProcess] controller.Controller initConfig (Controller.java:343) - The controller config has been initialized
2007-08-29 09:56:40,894 INFO  [testProcess] process.ProcessRunner run (ProcessRunner.java:102) - Initializing process engine
2007-08-29 09:56:40,894 INFO  [testProcess] process.ProcessRunner run (ProcessRunner.java:105) - Loading parameters
2007-08-29 09:56:41,942 INFO  [testProcess] process.ProcessRunner run (ProcessRunner.java:116) - Logging in to: https://www.salesforce.com
2007-08-29 09:56:42,741 INFO  [testProcess] dao.DataAccessObjectFactory getDaoInstance (DataAccessObjectFactory.java:51) - Instantiating data access object: queryAccount of type: databaseRead
2007-08-29 09:56:42,741 INFO  [testProcess] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions from file [c:\test_hms\database-conf.xml]
2007-08-29 09:56:42,834 INFO  [testProcess] process.ProcessRunner run (ProcessRunner.java:121) - Checking the data access object connection
2007-08-29 09:56:45,354 ERROR [testProcess] database.DatabaseContext initConnection (DatabaseContext.java:94) - Database error encountered during connecting for database configuration: queryAccount.  Sql error: Cannot create PoolableConnectionFactory (Io exception: The Network Adapter could not establish the connection).
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Io exception: The Network Adapter could not establish the connection)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855)
    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
    at com.salesforce.lexiloader.dao.database.DatabaseContext.initConnection(DatabaseContext.java:87)
    at com.salesforce.lexiloader.dao.database.DatabaseContext.checkConnection(DatabaseContext.java:79)
    at com.salesforce.lexiloader.dao.database.DatabaseReader.checkConnection(DatabaseReader.java:231)
    at com.salesforce.lexiloader.process.ProcessRunner.run(ProcessRunner.java:123)
    at com.salesforce.lexiloader.process.ProcessRunner.main(ProcessRunner.java:230)
Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:274)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:319)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:344)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:148)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:545)
    at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
    at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
    ... 6 more
2007-08-29 09:56:45,354 FATAL [testProcess] process.ProcessRunner run (ProcessRunner.java:155) - Database error encountered during connecting for database configuration: queryAccount.  Sql error: Cannot create PoolableConnectionFactory (Io exception: The Network Adapter could not establish the connection).


process-conf.xml
==========
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="testProcess" class="com.salesforce.lexiloader.process.ProcessRunner" singleton="false">
        <description>test from database</description>
        <property name="name" value="testProcess"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.endpoint" value="https://www.salesforce.com"/>
                <entry key="sfdc.username" value="a@gmail.com"/>
                <entry key="sfdc.password" value="xxxx"/>
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
                <entry key="sfdc.entity" value="Account"/>
                <entry key="process.operation" value="insert"/>
                <entry key="process.mappingFile" value="C:\testmap.sdl"/>
                <entry key="dataAccess.name" value="queryAccount"/>
                <entry key="dataAccess.type" value="databaseRead"/>
                </map>
        </property>
    </bean>


database-conf.xml
============
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>

<bean id="queryAccount"
      class="com.salesforce.lexiloader.dao.database.DatabaseConfig"
      singleton="true">
    <property name="sqlConfig" ref="queryAccountSql"/>
    <property name="dataSource" ref="dbDataSource"/>
</bean>

<bean id="dbDataSource"
      class="org.apache.commons.dbcp.BasicDataSource"
      destroy-method="close">
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="url" value="jdbc:oracle:thin:@my.server.com:1521:orcl"/>
    <property name="username" value="scott"/>
    <property name="password" value="tiger"/>
</bean>



<bean id="queryAccountSql"
      class="com.salesforce.lexiloader.dao.database.SqlConfig" singleton="true">
    <property name="sqlString">
        <value>
            SELECT c1,c2
            FROM test
            </value>
    </property>
    <property name="columnNames">
        <list>
            <value>c1</value>
            <value>c2</value>
            </list>
    </property>
    <property name="sqlParams">
        <map>
            <entry key="process.lastRunDate" value="java.sql.Timestamp"/>
        </map>
    </property>
</bean>

</beans>


Thanks a lot in advance
Ajay

  • August 29, 2007
  • Like
  • 0