function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ssuede7ssuede7 

custom field query error

Hi

I have created a custom boolean field in my Solutions. When I try to run a query that includes this field, I get an error:

org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject.Solution - TopSolution__c


I have generated a new WSDL file and recompiled. I have looked in the source code to verify that the custom field has indeed shown up.

Here is the query I am using (jSP):

QueryResult qr = sforceLogin.getBindingStub().query("select solutionname, solutionnumber, TopSolution__c from solution where solutionnumber = '00000012'");

Any Ideas??
ssuede7ssuede7
ok, I think the error I am having is actually related to the fact that the code I am generating from the wsdl2java utility is not being placed correctly.

I am running Tomcat. After I generate the java from the wsdl2java, I take this code and place it in the WEB-INF/classes dir. It seems however that tomcat won't compile that new code. So I attempted to manually compile it, but it didn't seem to help. I am still getting the "java.lang.NoClassDefFoundError: com/sforce/soap/enterprise/SforceService (wrong name: SforceService)"

Somebody please help. I have been tring to figure this out for hours and I'm working on a deadline. Any comments would be welcome.
ssuede7ssuede7
My API is 5.0 and I'm working in JSP
DevAngelDevAngel

Try creating a war file and deploy that each time you make a change.

ssuede7ssuede7
It turns out there was a problem the way I was compiling the source code generated from the WSDL. Thanks for the input though.
ksparkspar
I'm having the same kind of issue... my custom field (in Contact) is definitely there and I've stripped down my environment so that there's no other non-custom Contact.class within reach (as standalone .class or in a .jar).

What was your compilation problem? I may be doing something similar.

thx,
David
ksparkspar
Okay, to answer my own dilemma... it wasn't a compile-time issue... I just didn't see that SalesForce is appending 2 underscores in front of the c for custom fields. I asked somebody (younger, with better eye sight) to look over my shoulder and he immediately saw that it's setMyField__c not setMyField_c. Oops.

David