You need to sign in to do that
Don't have an account?

Invalid element in com.sforce.soap.enterprise.sobject.SObject - Plan_Summe__c
Hello,
handling the sforce - API is quiet new to me. I think it's the best way to describe what I've already done:
I've downloaded the Enterprise WSDL, and succeeded in generating customer object classes.
When I try to query any one of these customer object, I get the message above.
...
queryString = "select Plan_Summe__c from Projekt__c";
try {
qr = binding.query(queryString);
boolean done = false;
qr = binding.query(queryString);
boolean done = false;
if (qr.getSize() > 0) {
while (!done) {
for (int i = 0; i < qr.getRecords().length; i++) {
Projekt__c records = (Projekt__c) qr.getRecords(i);
System.out.println("Summe: " + i + " " + records.getPlan_Summe__c());
}
while (!done) {
for (int i = 0; i < qr.getRecords().length; i++) {
Projekt__c records = (Projekt__c) qr.getRecords(i);
System.out.println("Summe: " + i + " " + records.getPlan_Summe__c());
}
...
When I try to bypass the 'invalid field' problem by using an ID-field as it is used in alle SObject classes, I will encounter a ClassCastException. Querying a standard SObject (e.g. Contact) works fine. The debugger showed that the QueryResult contains an array of com.sforce.soap.enterprise.sobject.SObject when it should instanciate com.sforce.soap.enterprise.sobject.Projekt__c.
What could be the problem?
Thanks in advance.
Andy
__equalsCalc= null
__hashCodeCalc= false
done= true
queryLocator= null
records= SObject[88] (id=177) <= shouldn't this be records = Projekt__c[88] (id=177)
[0]= SObject (id=180) <= [0] = Projekt__c (id=180)
....
loginResult.getServerUrl() = "https://eu0-api.salesforce.com/services/Soap/c/7.0"
Hi Andy Iam also getting the same problem you got?, I have genetrated new stubs using new WSDL . I have added a Quotes App & now I want to query that custom object.
My Query is
"binding.query("select opportunity__c from SFDC_520_Quote__c")" and iam getting same error as You.
Iam able to get Metadata of that custom Object.
Can u please tell me how could you solved it.
Sudheer Tumu