-
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 Sales Cloud Basics - An Overview
In this top salesforce blog, we will be discussing, the basics of Salesforce Sales Cloud and What is the Purpose of Sales Cloud in Salesforce.…
How to Stop a Journey in Salesforce Marketing Cloud
It was time-consuming to pause Salesforce Marketing Cloud's progress. It will provide you with tips to help you save money while still achieving them. Marketing…
What are Auto-Launched Flows? | All You Need to Know
What are Auto-launched Flows? A certain event, such as the creation or updating of a record or the receiving of a platform event, can automatically…
Popular Salesforce Videos
Salesforce lightning customize record page: Build a Custom Record Page
Salesforce Lightning Experience comes with a slick user interface that is easy to navigate and even easier to use right from the beginning. Lightning is…
How to Enable the New Pardot Email Builder | Salesforce Pardot
Learn how to set up the new Email Builder for Pardot and set up Salesforce CMS for email content storage. Watch this video and do…
Kizzy Consulting Salesforce Services - Grow Your Business 2X With Salesforce CRM
Kizzy Consulting is a Salesforce Ridge Consulting Partner in the USA and has successfully implemented 100+ Salesforce projects for 100+ clients across sectors like Financial Services,…