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
BigPBigP 

How can i query from parent(Account)to child(Job)

Account:Id,Name,Amount.
Job:Name,Amount
Best Answer chosen by BigP
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Enea,

There was Comma missing after Amount field. Can you try now and let me know if you face any errors.
 
select id,name, Amount ,(select id,Name, Amount__c from jobs__r) from account

Thanks,
 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Enea,

You have to query using inner query as below.
 
select id,name, Amount (select id,Name, Amount__c from jobs__r) from account
Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,


Thanks
 
BigPBigP
Hi Sai
Im using data export and it says error.
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Enea,

Did you check by executing the query in Developer Console Query Editor.

Thanks,
 
BigPBigP
Yes i did the same error.
 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Enea,

Can you let me know what is the error and can you let me know what is the API name of the Jobs object?

Thanks,
 
BigPBigP
ERROR at Row:1:Column:34
unexpected token: 'select'
Thanks,
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Enea,

There was Comma missing after Amount field. Can you try now and let me know if you face any errors.
 
select id,name, Amount ,(select id,Name, Amount__c from jobs__r) from account

Thanks,
 
This was selected as the best answer
BigPBigP
Thank you.