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

Queryresult structure for Flex/Apex

Assuming the structure for a queryresult is different in Flex (not sure if it is?), how can I get to the values stored within the objects which the queryresult brings back.

Specifically, I have a query which is bringing back 3 columns and 1 record.  2 out of the 3 columns are actually relationship objects with multiple records contained within them.  I need to get the values in the fields of these relationship objects in order to do processing with them...

This pseudo format is returning blank when I can see the data in the apex explorer-


Any help is greatly appreciated...
are you using a nested query?
yes I guess you can call it that
If you have an aggregate child query (e.g. select name, (select firstname from contacts) from account) then, the contacts object in the outer queryResult is another queryResult, rather than a directl array of contacts, so, you'd need something like
Thank you Simon...that did it.  You guys are all OK!
Okay, but what if it's a child-to-parent relationships using a Notation like:

SELECT Type, Name, Folder.Name, Folder.CreatedDate FROM Document

How can I access the fields Folder.Name, Folder.CreatedDate? Something like:
    queryresult.records[0].folder.records[0].name   or   queryresult.records[0]
doesn't work!

Actually I'm working with the IDE for Eclipse and tried this query with the Schema Browser and it groups Folder.Name and Folder.CreateDate in a "Lookup to Folder"-View. But I don't know what that means for the way how I can access it.