You need to sign in to do that
Don't have an account?
mukesh gupta
Parent-child relationship
Hi Expert,
I need to get all students name with his class. here class is a parent and student is child. means class 12 have student "A", "B" ,"C" etc.
Thanks
Mueksh
I think the basic SOQL is like the following:
If you want to retrieve a specific Class__c, add WHERE clause.
I hope it will be helpful.
Please mark it as best answer if it resolved the issue.
Best Regards
RahulKumar
What exactly you want ,Do you want to display in detail page ? if yes you can edit your class layout then add student as a related list .
If you want in apex .then you can get in two diffrent way .
Parent to child and child to parent Query .
If you want only class Name in staudent query then go for child to parent which can be solved by dot notation like below .
Check below link it will help !!
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_query_using.htm#sforce_api_calls_soql_relationships_query_using
Please check and let us know if it helps !!
Thanks
Manoj