• American Data
  • NEWBIE
  • 5 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 11
    Replies
It appears that when a lead is converted to another type of object (Account, Contact, Opportunity, etc) the lead record still exists, however, can't be updated.

I have a list of email addresses I want to process. Each email address represents a recipient that we cannot send emails to due to the CAN-SPAM Act.

My original plan was to lookup any Leads or Contacts that have matching email addresses, and update their email opt out flag to true. However, I'm finding that when many of the leads are returned, the update doesn't succeed presumably because they are converted leads!

If it is the case that converted leads can be querried but not updated, will I always have duplicate lead records hanging arround for the corresponding object they was converted to? If so I'll need to filter these out, as I only am concerned about active leads.

Thanks for any assistance in advance.

Regards,

Josh
Hello,

When attempting to perform the following query:

select ID, HasOptedOutOfEmail, Email from Lead where HasOptedOutOfEmail = false

I'm receiving the following error:

INVALID_FIELD: Bad field name 'HasOptedOutOfEmail' in select list of query call. Either this field does not exist, or access to this field is restricted by field level security settings.

There is another query within my program that runs without problem, and uses the Lead HasOptedOutOfEmail field.

Select CreatedDate, FirstName, LastName, Email, ID from Lead Where CreatedDate >= 2005-11-15T00:00:00-07:00 And CreatedDate < 2005-11-16T00:00:00-07:00 And Status = 'Open' And HasOptedOutOfEmail = false

I've reviewed the field level security settings and all the levels are set to visible. None are marked as read-only.

Any assistance in resolving why I'm receiving this exception in the first query but not the second is greatly appreciated.

Thank you,

Josh
Hello,

I just generated java code from our Enterprise WSDL file using Apache Axis 1.2.1. I used the WSDL2Java utility to accomplish this.

Our program previously had no reason to access custom fields within salesforce and therefore used the SalesForce6.0.jar. Now that our program needs to work with the custom fields, I've created a jar file with the classes output from WSDL2java )run against our Enterprise WSDL), and have replaced the SalesForce6.0.jar the new one.

I'm getting some compilation errors with the new jar. The news stubs seem to have generated appropriately (I see our custom fields within the classes) however it appears that I might be missing some classes that used to be in the SalesForce6.0.jar. The missing classes are:

com.sforce.soap.enterprise._QueryOptions
com.sforce.soap.enterprise._SessionHeader
com.sforce.soap.enterprise.ID

Shouldn't these have been generated from the new WSDL? If not, any idea why?

Could someone please provide me with assistance with the following query question.

I would like to query a set of leads based upon the date the lead record was created.  It seems that the logical date to use is in the CreatedBy field.  However, this appears to be an aggregate field, i.e., containing two values.  Is it possible to query leads by their creation date? 

As a test I attempted to select the CreatedBy field with the following query and find what is returned:

Select CreatedBy, FirstName, LastName, Email, ID from Lead

I receive an error message which says "No such column "CreatedBy" on entity "Lead."  Since this is a system field, is it for some reason treated differently (i.e., it can't be selected?).

When this didn't work, I found that the Lead object has methods to return the createdDate and the createdID.  When I try and perform a query such as:

"Select FirstName, LastName, Email, ID from Lead"

and attempt to call lead.getCreatedDate() the return value is "null".

I'd really prefer to select based on the creation date, and query all the leads and then filter them by creation date after they are returned.  This creates a lot of unneeded overhead.

So far none of these attempts are bringing me closer to understanding how to query a lead based on the creation date.  To be honest, I didn't think this last attempt would work since CreateBy was not selected, but I figured I'd see what I could learn from trying.

Thanks in advance for anyone who can assist.

If it makes any difference, I'm using the Java API.

Regards,

Josh

Can anyone recommend a way to check if a session is still available?  I know there are ways to set the expiration period, however, I'd like my program to be aware of the session state so it can request a new one if it has timed out.

Currently I've wrapped the SoapBindingStub in a Singleton.  On every call to getInstance() of my singleton, I can check the status of the session before returning the SoapBindingStub.  This way, I can request a new stub if it has expired.

I can't seem to locate a means to check for session state in the API documentation.  I know it is kind of a hack, but would checking the value of SoapBindingStub.getUserInfo() tell me anything?  i.e., if the session is expired would this return null or throw an exception I could catch and then create a new instance of the SoapBindingStub.

Any suggestions on how to do so a more appropriate way?

Thanks again in advance.

Regards,

Hello,

I'm experiencing some wierd behavior when attempting to obtain a SoapBindingStub.

I attempt to access such an object by performing the following:

try {
   binding = ( SoapBindingStub ) new SforceServiceLocator().getSoap();
   logger.info( "getSFConnection> UserInfo = " + binding.getUserInfo() );
  } catch ( Exception e ) {
   logger.error( "getSFConnection> Could not get a SoapBindingStub", e );
  }

When I run this code segment, the attempt to get the binding throws an Exception.  My stack trace looks as follows:

2005-08-12 10:16:43,433 [ERROR] com.americandatacorp.salesforce.SFBinding - getSFConnection> Could not get a SoapBindingStub

AxisFault

faultCode: {urn:fault.enterprise.soap.sforce.com}UNKNOWN_EXCEPTION

faultSubcode:

faultString: UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService

faultActor:

faultNode:

faultDetail:

{urn:fault.enterprise.soap.sforce.com}fault:

UNKNOWN_EXCEPTION

Destination URL not reset. The URL returned from login must be set in the SforceService

UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:80)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:44)

at java.lang.reflect.Constructor.newInstance(Constructor.java:315)

at java.lang.Class.newInstance3(Class.java:367)

at java.lang.Class.newInstance(Class.java:305)

at org.apache.axis.encoding.ser.BeanDeserializer.(BeanDeserializer.java:125)

at org.apache.axis.encoding.ser.BeanDeserializer.(BeanDeserializer.java:111)

at com.sforce.soap.enterprise.fault.UnexpectedErrorFault.getDeserializer(UnexpectedErrorFault.java:85)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)

at java.lang.reflect.Method.invoke(Method.java:391)

at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:176)

at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:117)

at org.apache.axis.encoding.DeserializationContextImpl.getDeserializer(DeserializationContextImpl.java:466)

at org.apache.axis.encoding.DeserializationContextImpl.getDeserializerForType(DeserializationContextImpl.java:481)

at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:172)

at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963)

at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)

at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

at javax.xml.parsers.SAXParser.parse(Unknown Source)

at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)

at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)

at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)

at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:826)

at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:142)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)

at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)

at org.apache.axis.client.Call.invokeEngine(Call.java:2610)

at org.apache.axis.client.Call.invoke(Call.java:2599)

at org.apache.axis.client.Call.invoke(Call.java:2279)

at org.apache.axis.client.Call.invoke(Call.java:2200)

at org.apache.axis.client.Call.invoke(Call.java:1714)

at com.sforce.soap.enterprise.SoapBindingStub.getUserInfo(SoapBindingStub.java:1903)

at com.americandatacorp.salesforce.SFBinding.getSFConnection(SFBinding.java:80)

at com.americandatacorp.salesforce.SFBinding.(SFBinding.java:53)

at com.americandatacorp.salesforce.SFBinding.getInstance(SFBinding.java:64)

at com.lactagen.automatedmailing.configuration.ConfigurationFileReader.readFile(ConfigurationFileReader.java:69)

at com.lactagen.automatedmailing.configuration.ConfigurationFactory.configure(ConfigurationFactory.java:120)

at Test.main(Test.java:57)

I believe I'm following the use of the API correctly to obtain such a binding object.  Could anyone provide me with some direction on what might be going wrong?

For the record, I'm using java version 1.4.2, and have several other java libraries in my classpath that are required for this integration (J2EE, JDOM, Log4j, Commons-net, + the ones required for Sforce).

Thanks for any assistance in advance.

 

It appears that when a lead is converted to another type of object (Account, Contact, Opportunity, etc) the lead record still exists, however, can't be updated.

I have a list of email addresses I want to process. Each email address represents a recipient that we cannot send emails to due to the CAN-SPAM Act.

My original plan was to lookup any Leads or Contacts that have matching email addresses, and update their email opt out flag to true. However, I'm finding that when many of the leads are returned, the update doesn't succeed presumably because they are converted leads!

If it is the case that converted leads can be querried but not updated, will I always have duplicate lead records hanging arround for the corresponding object they was converted to? If so I'll need to filter these out, as I only am concerned about active leads.

Thanks for any assistance in advance.

Regards,

Josh
Hello,

I just generated java code from our Enterprise WSDL file using Apache Axis 1.2.1. I used the WSDL2Java utility to accomplish this.

Our program previously had no reason to access custom fields within salesforce and therefore used the SalesForce6.0.jar. Now that our program needs to work with the custom fields, I've created a jar file with the classes output from WSDL2java )run against our Enterprise WSDL), and have replaced the SalesForce6.0.jar the new one.

I'm getting some compilation errors with the new jar. The news stubs seem to have generated appropriately (I see our custom fields within the classes) however it appears that I might be missing some classes that used to be in the SalesForce6.0.jar. The missing classes are:

com.sforce.soap.enterprise._QueryOptions
com.sforce.soap.enterprise._SessionHeader
com.sforce.soap.enterprise.ID

Shouldn't these have been generated from the new WSDL? If not, any idea why?

Could someone please provide me with assistance with the following query question.

I would like to query a set of leads based upon the date the lead record was created.  It seems that the logical date to use is in the CreatedBy field.  However, this appears to be an aggregate field, i.e., containing two values.  Is it possible to query leads by their creation date? 

As a test I attempted to select the CreatedBy field with the following query and find what is returned:

Select CreatedBy, FirstName, LastName, Email, ID from Lead

I receive an error message which says "No such column "CreatedBy" on entity "Lead."  Since this is a system field, is it for some reason treated differently (i.e., it can't be selected?).

When this didn't work, I found that the Lead object has methods to return the createdDate and the createdID.  When I try and perform a query such as:

"Select FirstName, LastName, Email, ID from Lead"

and attempt to call lead.getCreatedDate() the return value is "null".

I'd really prefer to select based on the creation date, and query all the leads and then filter them by creation date after they are returned.  This creates a lot of unneeded overhead.

So far none of these attempts are bringing me closer to understanding how to query a lead based on the creation date.  To be honest, I didn't think this last attempt would work since CreateBy was not selected, but I figured I'd see what I could learn from trying.

Thanks in advance for anyone who can assist.

If it makes any difference, I'm using the Java API.

Regards,

Josh

Can anyone recommend a way to check if a session is still available?  I know there are ways to set the expiration period, however, I'd like my program to be aware of the session state so it can request a new one if it has timed out.

Currently I've wrapped the SoapBindingStub in a Singleton.  On every call to getInstance() of my singleton, I can check the status of the session before returning the SoapBindingStub.  This way, I can request a new stub if it has expired.

I can't seem to locate a means to check for session state in the API documentation.  I know it is kind of a hack, but would checking the value of SoapBindingStub.getUserInfo() tell me anything?  i.e., if the session is expired would this return null or throw an exception I could catch and then create a new instance of the SoapBindingStub.

Any suggestions on how to do so a more appropriate way?

Thanks again in advance.

Regards,

Hello,

I'm experiencing some wierd behavior when attempting to obtain a SoapBindingStub.

I attempt to access such an object by performing the following:

try {
   binding = ( SoapBindingStub ) new SforceServiceLocator().getSoap();
   logger.info( "getSFConnection> UserInfo = " + binding.getUserInfo() );
  } catch ( Exception e ) {
   logger.error( "getSFConnection> Could not get a SoapBindingStub", e );
  }

When I run this code segment, the attempt to get the binding throws an Exception.  My stack trace looks as follows:

2005-08-12 10:16:43,433 [ERROR] com.americandatacorp.salesforce.SFBinding - getSFConnection> Could not get a SoapBindingStub

AxisFault

faultCode: {urn:fault.enterprise.soap.sforce.com}UNKNOWN_EXCEPTION

faultSubcode:

faultString: UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService

faultActor:

faultNode:

faultDetail:

{urn:fault.enterprise.soap.sforce.com}fault:

UNKNOWN_EXCEPTION

Destination URL not reset. The URL returned from login must be set in the SforceService

UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:80)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:44)

at java.lang.reflect.Constructor.newInstance(Constructor.java:315)

at java.lang.Class.newInstance3(Class.java:367)

at java.lang.Class.newInstance(Class.java:305)

at org.apache.axis.encoding.ser.BeanDeserializer.(BeanDeserializer.java:125)

at org.apache.axis.encoding.ser.BeanDeserializer.(BeanDeserializer.java:111)

at com.sforce.soap.enterprise.fault.UnexpectedErrorFault.getDeserializer(UnexpectedErrorFault.java:85)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)

at java.lang.reflect.Method.invoke(Method.java:391)

at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:176)

at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:117)

at org.apache.axis.encoding.DeserializationContextImpl.getDeserializer(DeserializationContextImpl.java:466)

at org.apache.axis.encoding.DeserializationContextImpl.getDeserializerForType(DeserializationContextImpl.java:481)

at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:172)

at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963)

at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)

at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

at javax.xml.parsers.SAXParser.parse(Unknown Source)

at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)

at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)

at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)

at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:826)

at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:142)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)

at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)

at org.apache.axis.client.Call.invokeEngine(Call.java:2610)

at org.apache.axis.client.Call.invoke(Call.java:2599)

at org.apache.axis.client.Call.invoke(Call.java:2279)

at org.apache.axis.client.Call.invoke(Call.java:2200)

at org.apache.axis.client.Call.invoke(Call.java:1714)

at com.sforce.soap.enterprise.SoapBindingStub.getUserInfo(SoapBindingStub.java:1903)

at com.americandatacorp.salesforce.SFBinding.getSFConnection(SFBinding.java:80)

at com.americandatacorp.salesforce.SFBinding.(SFBinding.java:53)

at com.americandatacorp.salesforce.SFBinding.getInstance(SFBinding.java:64)

at com.lactagen.automatedmailing.configuration.ConfigurationFileReader.readFile(ConfigurationFileReader.java:69)

at com.lactagen.automatedmailing.configuration.ConfigurationFactory.configure(ConfigurationFactory.java:120)

at Test.main(Test.java:57)

I believe I'm following the use of the API correctly to obtain such a binding object.  Could anyone provide me with some direction on what might be going wrong?

For the record, I'm using java version 1.4.2, and have several other java libraries in my classpath that are required for this integration (J2EE, JDOM, Log4j, Commons-net, + the ones required for Sforce).

Thanks for any assistance in advance.