-
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

How to Become a Salesforce Developer?
Salesforce, according to the producing company’s website, is “the world’s #1 customer relationship management (CRM) platform.” Their software is designed to help businesses grow by…

Salesforce Winter '22 Release Highlights
With fall now upon us, the weather is cooling, the leaves are changing, and the Salesforce Winter '22 Release is here! Chock-full of impressive new…

Salesforce Marketing Cloud Automation Studio and Its Activities
Automation Studio Automation Studio is a very awesome tool in Salesforce Marketing Cloud. One can perform lots of tasks via automation studio. It helps us…
Popular Salesforce Videos
4 Benefits of Salesforce Data Services (ETL)
When your enterprise needs to integrate data from a different application, Salesforce Data Services will help your company in Extracting, Transforming, and Loading the gathered…
Algoworks is Now a Salesforce Gold Partner
Being just a registered partner back in 2013, the journey to striking Gold in 2020 has been long. On the way to getting that Gold,…
How to Use Product Rules with Salesforce CPQ
In this demo video, you'll learn about the three most popular types of product rules for CPQ: validation, alert, and selection. You'll also see how…