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
Prakhyat sapraPrakhyat sapra 

getting account & there related contact through soql queary in the salesforce???

getting account & there related contact through soql queary in the salesforce???
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Prakhyat,


You can use the SOQL query as below and include all the required fields in it.
 
select id,name,(select id,Lastname  from contacts) from Account

Let me know if you face any issues.

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

Thanks,
Prakhyat sapraPrakhyat sapra
SELECT id,name,(SELECT id,LastName FROM contacts) FROM Account 
 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Prakhyat,

Did the SOQL query shared by me worked. Let me know if you face any issue in it.

I see your reply to the question which is what I shared. I did not get what exactly you are trying to explain.

If  the  solution which I provided above helped you, Please mark it as best answer.

Thanks,