-
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
Salesforce Consulting Services: How can you Achieve your Business Goals in 2023?
Salesforce is a popular CRM solution. According to reports, Salesforce has helped clients increase their revenue by 25%. Salesforce technology places a strong emphasis on creating a…
Batch Apex in Salesforce - Learn About the Advantages and Syntax
Batch class in Salesforce is utilized to run huge positions (think thousands or millions of records!) that would surpass typical handling limits. Utilizing Batch Apex,…
What Slack and Salesforce Sales Cloud Could Do for Your Business
Today’s customers no longer prefer emails and phone calls. Customers anticipate continuous vendor assistance and participation. This means that reps must spend more time building…
Popular Salesforce Videos
How to Crack Salesforce Platform Developer I Exam in 2021?
Salesforce Platform Developer I Certification Training ensures that you master the concepts and components of application development on the Salesforce platform. Watch this video and…
Salesforce Trailblazer Answers Leaders on YouTube
At Salesforce we’re using the power of our Trailblazer Community with Slack Connect to scale self-help content creation. Watch this short video to learn how…
What is the Difference Between Object and Database in Salesforce?
Salesforce Object: Salesforce Object are database table which give permission to store data that is specific to organization. Salesforce Database: The organized collection of object…