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
edwinfarraredwinfarrar 

INVALID_FIELD error when field is in WSDL

I am attempting a very simple query on the Opportunity object which includes a custom column. The column is listed in the wsdl (v9). The query succeeds when implemented through DBAmp and Apex Explorer 8.0. However, when the same query is attempted through the .NET API, it fails with the following message:
 Source: SforceProvider
 Error:  INVALID_FIELD: No such column 'TSO_User__c' on entity 'Opportunity'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
 Type:   System.Web.Services.Protocols.SoapException
 Stack:  System.Web.Services.Protocols.SoapException: INVALID_FIELD: No such column 'TSO_User__c' on entity 'Opportunity'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
Any thoughts?
SuperfellSuperfell
What API version is your .NET code using ?
edwinfarraredwinfarrar
I beleive it is version 9.0. Below is the verbiage from the wsdl header:
 
Salesforce.com Enterprise Web Services API Version 9.0
Generated on 2007-04-30 16:43:56 +0000.
edwinfarraredwinfarrar
Also, I can see the TSO_User__c column in the object browser of visual studio when drilling through the web reference.
SuperfellSuperfell
Well your code can change the endpoint URL from the default one in the WSDL, typically you see these sorts of problems when you're trying to access a field type that's not available in older API versions. You might want to get a network capture of your request, or double check that your code is not changing the URL, or picking it up from somewhere else (like a config file) instead.
edwinfarraredwinfarrar
The URL is

https://na1-api.salesforce.com/services/Soap/u/5.0

I am assuming this should actually be

https://na1-api.salesforce.com/services/Soap/u/9.0

Is this correct?

SuperfellSuperfell
The number on the end is API version. You should really review all the releases notes for 6.0, 7.0, 8.0 & 9.0 before switching it over to the 9.0 API. In general its fairly easy to move forward, but there's normally some semantic changes between releases (e.g. getUpdated & getDeleted changed in 8.0) that you might need to take into account.
ecerboneecerbone
I just went through this two days ago.  My client has a field called Publish within a custom sObject and I could not query on that column.  Unfortunately, the solution for me was calling sForce and having them create a second column called Publish2.  Support then repopulated the new column with the old column values and it is good.  I don't know what was wrong, but now it works.
edwinfarraredwinfarrar
I updated the URL in the project and it is all working now. The problem was in a dll being used by the original developor of the code I am now maintaining. Inside his dll is where the URL was point to version five.
 
Thanks for the help.