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
k209310k209310 

Querying Custom Fields

Hi There. Im new to this so [please bear with me.

I am currently triying to develop a Java Interface to SalesForce and have had no real problems untill now.  Im sure there is a simple way to do this but after an afternoon with my head in the API I just seem to be going round in circles.

We have a Custom Formula Field and have been trying to access its data. We have tried a variety of methods using amongst other things the query and retrieve methods in SoapBindingStub.

I have tried accessing the table meta data via the DescribeSObjectResult object and can see that the field exists. However I need is someway to see the data.

We have been able to access a Custom Picklist Fields data easily using the Field getPickListDataValues() but not the Formula Fields

Does any one have any ideas?

Thanks

Chris
SuperfellSuperfell
formula fields work just like any other field.

select customFieldName__c from [objectName]
k209310k209310
Thanks for the reply but Ive still had no luck.

Im still having problems tho when querying the custom fields I keep on getting the following exception.

org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject.Account - Frequent_Filer_Discount__c

I get this from the query: SELECT Frequent_Filer_Discount__c FROM account WHERE id='0013000000ApqwhAAB'

Does anyone have anyideas where im going wrong here?
SuperfellSuperfell
re-download your WSDL, the field was added after your current WSDL was downloaded, so your client stubs know nothing about that field.
k209310k209310
I am using wsdl4j-1.5.1.jar is this the wsdl that I need to refer to?

Thanks
SuperfellSuperfell
No, the WSDL file from the application, that you then run WSDL2Java on. See the getting started guide in the docs.
kamalkumarkamalkumar

Chris,

I am new to Java and Salesforce . I am looking forward to use the custom objects from a JSP page and not able to do that.

if possible do provide the working code using the custom objects.

Thanks in advance