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

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

I am using the 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.



Best Answer chosen by Admin (Salesforce Developers) 


All Answers


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



This was selected as the best answer