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
dongdong 

SOQL query error about this field "product_family__c"

Hi  All,
   I met a SOQL query error ,  Who could tell me why?
 The case is , I  can  retrieve data from sforce explore by the following SOQL :
 
select case.owner.name, case.owner.userRole.name ,subject, status ,origin ,reason,  
           caseNumber,product_family__c,createdDate from case  limit 20
 
So , I use the following code to send my query.
 
  QueryResult qr =
             binding.query(               
               "select case.owner.name, case.owner.userRole.name ,subject, status ,origin ,reason,  " +
               "caseNumber,product_family__c,createdDate from case  limit 20 ");
However, the  error message is :
 
Exception:
org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject._case - Product_Family__c
 at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
 at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
 at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
 at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
 at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
 at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
 at org.apache.axis.client.Call.invoke(Call.java:2467)
 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.Samples.querySample(Samples.java:287)
 at org.salesforce.quickstart.Samples.run(Samples.java:343)
 at org.salesforce.quickstart.Samples.main(Samples.java:38)
Exception in thread "main" AxisFault
...................................................................................................................................................................
If I delete Product_Family__c  in my SOQL, the query is OK. So what shall I do  if  I  still want to get  Product_Family__c   field's  value back from salesforce?     
 
 
 
canonwcanonw
I can think of two reasons.

1.  The code web service API is not updated.
2.  The profile executing the code does not have the permission to access "product_family__c".
dongdong
Thanks for you reply.  But How do I update my webservice API ?  I just registered a developer account and then downloaded a WSDL from salesforce(SF) , later I generated my code by axis.  So  How do I update my webservice API according to my company's requirement?   Sorry, I am quite new to SF development!!
 
 
canonwcanonw
Checkout this url

http://wiki.apexdevnet.com/index.php/Web_Services_API#Java

I highly recommand you to spend quality time to grasp fundamental concept.  As you progress to other technical stuff, these concept are essential to your own success.