-
How to debug the child values in parent to child query using for loop?
List<Account> accs=[select id,name,Phone,
(select id,lastname,firstname,email
from contacts)
from account];for(Account aa:accs){
System.debug(aa.id);
System.debug(aa.name);
System.debug(aa.phone);
}
for(Contact con:accs.contacts){}
The first loop runs error free while the second loop throws up some error. I have the parent values in the first loop but i need the child values in it as well. Can anyone help?
Log In to reply.
Popular Salesforce Blogs
Navigation Service in Lightning Web Component | All You Need to Know
Use the navigation service lightning/navigation to navigate in Lightning Experience, Lightning Communities, and the Salesforce app. Only Lightning Experience, Lightning Communities, and the Salesforce app…
Permission Sets in Salesforce - Learn About Its Different Types
A permission set is a collection of settings and permissions that give users access to various tools and features. Permission sets extend users' functional access…
Automate to Upload Files on Amazon S3 Through Salesforce Apex
Amazon S3 is a web service offered by Amazon Web Services. Amazon S3 provides storage through web services interfaces. With the help of the following…
Popular Salesforce Videos
Introduction to Report and Dashboard in Salesforce | Salesforce Training Videos
A report is a list of records that meet the criteria you define. It's displayed in Salesforce in rows and columns, and can be filtered,…
Salesforce Interview Questions and Answers - For Freshers and Experienced Candidates
Learn most important Salesforce Interview Questions and Answers, asked at every interview. These Interview questions will be useful to all entry-level candidates, beginners, interns, and…
The Only Salesforce Developer Video Tutorial Course You Will Ever Need!
A Salesforce developer is a programmer who builds Salesforce applications across various PaaS (Platform as a Service) platforms. A Salesforce developer has an understanding of…