+ Start a Discussion
Sunil Kumar 545Sunil Kumar 545 

hi ,if i account is created related to (multiple contact )it should return multiple contact using apex class

list of contact insert ,using list of parameters passing in apex class
SandhyaSandhya (Salesforce Developers) 
Hi,

Below is the sample query for the same.
 
SELECT Id, Name FROM Contact WHERE Id IN (SELECT ContactId FROM AccountContactRelation WHERE AccountId = <account Id here>)
or 
SELECT Id, (SELECT Contact.Name FROM AccountContactRelations) FROM Account WHERE Id = <account Id here>)

Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya
 
 
Sunil Kumar 545Sunil Kumar 545
can u send by using apex class how to implement it..
 
Sunil Kumar 545Sunil Kumar 545
can u send this requirement in apex code ..how to implement it?