-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
2Questions
-
7Replies
import?
private void describeSObjectsSample()
{
try {
DescribeSObjectResult[] describeSObjectResults =
binding.describeSObjects(new String[] {"account", "contact", "lead"});
for (int x=0;x<describeSObjectResults.length;x++)
{
DescribeSObjectResult describeSObjectResult = describeSObjectResults[x];
// Retrieve fields from the results
Field[] fields = describeSObjectResult.getFields();
// Get the name of the object
String objectName = describeSObjectResult.getName();
// Get some flags
boolean isActivateable = describeSObjectResult.isActivateable();
System.out.println("Object name: " + objectName);
// Many other values are accessible
if (fields != null)
{
// Iterate through the fields to get properties for each field
for (int i = 0; i < fields.length; i++)
{
Field field = fields[i];
int byteLength = field.getByteLength();
int digits = field.getDigits();
String label = field.getLabel();
int length = field.getLength();
String name = field.getName();
PicklistEntry[] picklistValues = field.getPicklistValues();
int precision = field.getPrecision();
String[] referenceTos = field.getReferenceTo();
int scale = field.getScale();
FieldType fieldType = field.getType();
boolean fieldIsCreateable = field.isCreateable();
System.out.println("Field name: " + name);
// Determine whether there are picklist values
if (picklistValues != null && picklistValues[0] != null)
{
System.out.println("Picklist values = ");
for (int j = 0; j < picklistValues.length; j++)
{
if (picklistValues[j].getLabel() != null)
{
System.out.println(" Item: " +
picklistValues[j].getLabel());
}
}
}
// Determine whether this field refers to another object
if (referenceTos != null && referenceTos[0] != null)
{
System.out.println("Field references the following objects:");
for (int j = 0; j < referenceTos.length; j++)
{
System.out.println(" " + referenceTos[j]);
}
}
}
}
}
}
catch (Exception ex) {
System.out.println("\nFailed to get object descriptions, error message was: \n" +
ex.getMessage());
}
}
}
----------------------------
in this line appear one error--> DescribeSObjectResult[] describeSObjectResults =
binding.describeSObjects(new String[] {"account", "contact", "lead"});
quickstart2.java:27: cannot find symbol
ÏϧÏsymbol : variable binding
ÏϧÏlocation: class org.salesforce.quickstart.quickstart2
ÏÏ§Ï binding.describeSObjects(new String[] {"account", "contact", "lead"});
I suppose i need an import, but i don't know which.
THANKS!
- david masonis
- July 17, 2008
- Like
- 0
- Continue reading or reply
MALFORMED_QUERY (im very novice :P )
// call the query saving the results in qr
try {
qr = binding.query("select c.accountid,c.closedDate,c.Description from case c,account ac where c.accountid=ac.accountNumber");//"select Name, numberOfEmployees, Id, Industry from Account }
catch (UnexpectedErrorFault uef) {
ERROR
------------
RESULTADO DEL ERROR (THIS IS NOT THE HOLY BIBLE :P)
-----------------------------------------
AxisFault
faultCode: {urn:fault.enterprise.soap.sforce.com}MALFORMED_QUERY
faultSubcode:
faultString: MALFORMED_QUERY:
c,account ac where c.accountId=ac.accountNumber
^
ERROR at Row:1:Column:88
unexpected token: ac.accountNumber
faultActor:
faultNode:
faultDetail:
{urn:fault.enterprise.soap.sforce.com}fault:<ns1:exceptionCode>MALFORMED_QUERY</ns1:exceptionCode><ns1:exceptionMessage>
c,account ac where c.accountId=ac.accountNumber
^
ERROR at Row:1:Column:88
unexpected token: ac.accountNumber</ns1:exceptionMessage><ns1:row>1</ns1:row><ns1:column>88</ns1:column>
c,account ac where c.accountId=ac.accountNumber
^
ERROR at Row:1:Column:88
unexpected token: ac.accountNumber
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90)
at com.sforce.soap.enterprise.fault.MalformedQueryFault.getDeserializer(MalformedQueryFault.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:154)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84)
at org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464)
at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547)
at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.sforce.soap.enterprise.SoapBindingStub.query(SoapBindingStub.java:3222)
at org.salesforce.quickstart.quickstart.doGetAccounts(quickstart.java:138)
at org.salesforce.quickstart.quickstart.mainLoop(quickstart.java:83)
at org.salesforce.quickstart.quickstart.<init>(quickstart.java:47)
at org.salesforce.quickstart.quickstart.main(quickstart.java:42)
THANKS A LOT!!!
- david masonis
- July 16, 2008
- Like
- 0
- Continue reading or reply
import?
private void describeSObjectsSample()
{
try {
DescribeSObjectResult[] describeSObjectResults =
binding.describeSObjects(new String[] {"account", "contact", "lead"});
for (int x=0;x<describeSObjectResults.length;x++)
{
DescribeSObjectResult describeSObjectResult = describeSObjectResults[x];
// Retrieve fields from the results
Field[] fields = describeSObjectResult.getFields();
// Get the name of the object
String objectName = describeSObjectResult.getName();
// Get some flags
boolean isActivateable = describeSObjectResult.isActivateable();
System.out.println("Object name: " + objectName);
// Many other values are accessible
if (fields != null)
{
// Iterate through the fields to get properties for each field
for (int i = 0; i < fields.length; i++)
{
Field field = fields[i];
int byteLength = field.getByteLength();
int digits = field.getDigits();
String label = field.getLabel();
int length = field.getLength();
String name = field.getName();
PicklistEntry[] picklistValues = field.getPicklistValues();
int precision = field.getPrecision();
String[] referenceTos = field.getReferenceTo();
int scale = field.getScale();
FieldType fieldType = field.getType();
boolean fieldIsCreateable = field.isCreateable();
System.out.println("Field name: " + name);
// Determine whether there are picklist values
if (picklistValues != null && picklistValues[0] != null)
{
System.out.println("Picklist values = ");
for (int j = 0; j < picklistValues.length; j++)
{
if (picklistValues[j].getLabel() != null)
{
System.out.println(" Item: " +
picklistValues[j].getLabel());
}
}
}
// Determine whether this field refers to another object
if (referenceTos != null && referenceTos[0] != null)
{
System.out.println("Field references the following objects:");
for (int j = 0; j < referenceTos.length; j++)
{
System.out.println(" " + referenceTos[j]);
}
}
}
}
}
}
catch (Exception ex) {
System.out.println("\nFailed to get object descriptions, error message was: \n" +
ex.getMessage());
}
}
}
----------------------------
in this line appear one error--> DescribeSObjectResult[] describeSObjectResults =
binding.describeSObjects(new String[] {"account", "contact", "lead"});
quickstart2.java:27: cannot find symbol
ÏϧÏsymbol : variable binding
ÏϧÏlocation: class org.salesforce.quickstart.quickstart2
ÏÏ§Ï binding.describeSObjects(new String[] {"account", "contact", "lead"});
I suppose i need an import, but i don't know which.
THANKS!
- david masonis
- July 17, 2008
- Like
- 0
- Continue reading or reply
MALFORMED_QUERY (im very novice :P )
// call the query saving the results in qr
try {
qr = binding.query("select c.accountid,c.closedDate,c.Description from case c,account ac where c.accountid=ac.accountNumber");//"select Name, numberOfEmployees, Id, Industry from Account }
catch (UnexpectedErrorFault uef) {
ERROR
------------
RESULTADO DEL ERROR (THIS IS NOT THE HOLY BIBLE :P)
-----------------------------------------
AxisFault
faultCode: {urn:fault.enterprise.soap.sforce.com}MALFORMED_QUERY
faultSubcode:
faultString: MALFORMED_QUERY:
c,account ac where c.accountId=ac.accountNumber
^
ERROR at Row:1:Column:88
unexpected token: ac.accountNumber
faultActor:
faultNode:
faultDetail:
{urn:fault.enterprise.soap.sforce.com}fault:<ns1:exceptionCode>MALFORMED_QUERY</ns1:exceptionCode><ns1:exceptionMessage>
c,account ac where c.accountId=ac.accountNumber
^
ERROR at Row:1:Column:88
unexpected token: ac.accountNumber</ns1:exceptionMessage><ns1:row>1</ns1:row><ns1:column>88</ns1:column>
c,account ac where c.accountId=ac.accountNumber
^
ERROR at Row:1:Column:88
unexpected token: ac.accountNumber
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90)
at com.sforce.soap.enterprise.fault.MalformedQueryFault.getDeserializer(MalformedQueryFault.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:154)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84)
at org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464)
at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547)
at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.sforce.soap.enterprise.SoapBindingStub.query(SoapBindingStub.java:3222)
at org.salesforce.quickstart.quickstart.doGetAccounts(quickstart.java:138)
at org.salesforce.quickstart.quickstart.mainLoop(quickstart.java:83)
at org.salesforce.quickstart.quickstart.<init>(quickstart.java:47)
at org.salesforce.quickstart.quickstart.main(quickstart.java:42)
THANKS A LOT!!!
- david masonis
- July 16, 2008
- Like
- 0
- Continue reading or reply
Setting up eclipse for salesforce!
import com.sforce.soap.enterprise.AssignmentRuleHeader;
import com.sforce.soap.enterprise.LoginResult;
import com.sforce.soap.enterprise.QueryOptions;
import com.sforce.soap.enterprise.QueryResult;
import com.sforce.soap.enterprise.SaveResult;
import com.sforce.soap.enterprise.SessionHeader;
import com.sforce.soap.enterprise.SforceServiceLocator;
import com.sforce.soap.enterprise.SoapBindingStub;
import com.sforce.soap.enterprise.fault.InvalidIdFault;
import com.sforce.soap.enterprise.fault.InvalidSObjectFault;
import com.sforce.soap.enterprise.fault.LoginFault;
import com.sforce.soap.enterprise.fault.UnexpectedErrorFault;
import com.sforce.soap.enterprise.sobject.SObject;
All of the above cannot be resolved and really confuse! i have got all the classes generated from the enterprise WSDL also i have added the axis2 libraries to my build path! any technical advice?
B
Message Edited by Losintikfos on 07-16-2008 02:53 AM
Message Edited by Losintikfos on 07-16-2008 02:53 AM
Message Edited by Losintikfos on 07-16-2008 02:54 AM
- Losintikfos
- July 16, 2008
- Like
- 0
- Continue reading or reply
Web Form to Lead (Account, Opportunity, Case, etc...)
After reading through many threads and the PDF's, I am still a bit lost.
Can anyone layout the basics of how to accomplish the following:
- From within Java, Connect to SalesForce, Create a Lead
- From within Java, Connect to SalesForce, Create a Contact
- From within Java, Connect to SalesForce, Create an Account
- From within Java, Connect to SalesForce, Create a Case
- From within Java, Connect to SalesForce, Create a Lead, Then convert said lead into an account and opportunity
Again sorry if this is basic stuff... and if there is a good explaination somehwere i can read.. please point me to it.. i have not yet found it.
Thanks
- Glyph
- July 11, 2008
- Like
- 0
- Continue reading or reply