-3

Write a SOQL query to fetch Contacts from Account using record Id.

user44323
  • 1
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 26 '21 at 14:49
  • I am confuse because I know this query [select id, name,(select id,AccountId from Contacts) from Account where...] but what should I need to use in WHERE clause?. This is my question. Hope you understood. – user44323 Aug 26 '21 at 16:51
  • Have you read the [documentation](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select.htm)? – David Reed Aug 26 '21 at 23:31

1 Answers1

0

You can fetch contact information from account by using the following query:

SELECT Id, Name, (SELECT AccountId, Name, Email  FROM Contacts) 
FROM Account WHERE Id = 'record Id'
Salahuddin Ahmed
  • 4,854
  • 4
  • 14
  • 35