+ Start a Discussion
Iceman123Iceman123 

WSC: Can list of field names be returned from QueryResult?

I am using the Force.com WSC connector for Java.

 

Is it possible to return a list of fields or field names from a QueryResult's SObject?  I only see getField (which requires that I hardcode the name of the field of interest).  I am looking for something like getFields which returns an array of field objects or field names, etc..

 

I could go through and parse the select field statement to determine these names based on the query the user enters.  I just want to check here to see if there's a way to identify the list of fields requested from the QueryResult object.  Any feedback is appreciated.

 

thanks

Best Answer chosen by Admin (Salesforce Developers) 
Iceman123Iceman123

Thx! 

All Answers

dkadordkador

In WSC, the SObject class extends XmlObject, which has a method called getChildren() that should do what you want.

Iceman123Iceman123

Thx! 

This was selected as the best answer