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
Vijay RautVijay Raut 

Getting field value from the Join of two entity

Hi ,
I have done the Join of Account and Contact and retrived data from them.
But i want to put that data in into Array.
Like for one Account there are many contacts. So i have tried to take the fields as follows, but able to get only account fields and for contacts fields it is giving me error.




But in the QueryResult i am having all the data of contact. Its juct i m not getting way to use get method.

So please anyone having idea about how to overcome this then reply to this post.

Thanks in Advance

Can you post the query? I think beta toolkit does not support
relationship query. Please try to update to the production


Vijay RautVijay Raut

My query is something like as follows....

SELECT a.Id, a.Name,, (select,,, b.title FROM a.contacts b ) from account a

So after getting result set i am able to get the Id, Name, Site ( Which are account fileds) by


but not able to get id, name, email, title ( which are contact fields) by above way.

So please suggest me the way to get contacts fields.

And query returns contact information as i have checked the QueryResult.


Hi Vijay

Perhaps you noticed my post today. I am encountering the same problem. From what I can tell, the query you wrote is going to result in an array, with nested arrays. A single row of the array might look something like this:

{type:'Opportunity', Id:'00660000008GofYAAS', Account:{type:'Account', Id:null, Name:'Gift', }, Amount:'25350.0', }

This example is the result of the following query:

"Select Id, Account.Name, Amount From Opportunity limit 30", callback);

Long story short, I'd like to know the solution to this as well. How do you read the name: value pairs that are nested in the array? It is probably something dead simple. I'm a complete novice, but I found this a lot easier in Ruby on Rails.

This use case is supported very well in the production Ajax toolkit.

You can generate a Sample SControl for this query using Ajax Tools

Here are the steps:

1. Install the app
2. Click the explorer icon
3. Select SObject.
4. Select fields you want to query from the tree
5. Click the "Generate Sample" button.

This will generate an SControl that shows how to make the query call
and how to get the fields from the query result.


Vijay RautVijay Raut

Hi ,

I have not found way to get those fields. So i have found new way to do this by using the Reports.

I am using Contact and Account report and selected those column of account and contact i need.

Then in SControl given the Id of report, it returns the data in XML format.

So parse that XML and get the required fields.

And one more thing that Report works faster that the SOQL query.

Thank You.

Vijay RautVijay Raut

Hi Cheenath,

Thanks a lot for your help.....

Actually i have alredy used that QueryIterator but only thing was i havent updated the src to new one, hence it was giving me error for QueryIterator.