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
SergeantAgniSergeantAgni 

FaultCode 1218, though field name present in describe response

I'm just starting out to use the SForce API.  I'm using Java, Axis, and Jython.  My filter query calls to contact entities are working fine, but the same code used for campaign and lead enties reports bad field names for several fields that are listed as permitted by the coresponding describe calls.  For example, below is the error message when the select list of a filter query on a campaign entity includes only the "id" and "name" fields.

AxisFault
 faultCode: 1218
 faultSubcode:
 faultString: Bad field name 'name' in select list of query call
Bad field name 'name' in select list of query call

I would imagine I'm making an obvious or common mistake.  Thanks for your help.

--Brad

DevAngelDevAngel

Hi SergeantAgni,

There are several possible reasons for this.  One common reason is that the user used for the describe is different than the one used for the query and the one used for the query doesn't have the particular field in their layout.  (Seems unlikely that the name of a campaign would not be in every layout though.) 

So, to figure this out I will need a little more information.  As a standard practice, if you are getting errors from the API, you should include the SOAP request you are sending.  99 times out of 100 the reasons are revealed by examining the message. NOTE: When posting a SOAP or XML-RPC request, be sure to modify the session id as that id can be used to gain access to your data.

Can you verify access via the describe call for the same user that you are doing the query on?  Is your select list an array of strings without apostrophes?

SergeantAgniSergeantAgni

I have only one user at this time.  I'm using a new development account and have not yet added additional users.  The select list is specified as just a simple array of strings, no apostrophes.

The most useful thing would be for me to include the SOAP request at this point, however I haven't figured out how to gather that yet data yet.  I will need to study the Axis tools and software some more and do that later.

Thanks for responding.

--Brad

SergeantAgniSergeantAgni

Using TCPMonitor I was able to capture the SOAP request and response.  Examining this showed a simple coding error.  I was specifying the wrong entity name.  So queries worked for contacts but not for leads and campaigns.  

Now I've got the debugging tools down and I won't bother you for such silly things in the future.  Thanks for your tolerance.

--Brad