-
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
Guide To Component Event And Application Event in Salesforce
Component Event Component event is fired by the when we instantiate the component. The component is fired from the child component and handled by the…
Enabling Ideas in Salesforce Community Cloud: A Vital Step for Better Community Optimization
Every successful business today is a tree grown from a seed named ‘idea’. The greatest of today’s technologies and software are the products of great…
AgentForce AI Agents: Automate Sales & Support in Salesforce
Businesses using Salesforce can improve their sales and customer support with AgentForce AI agents. These AI-powered tools help teams work faster, automate tasks, and improve…
Popular Salesforce Videos
Permissions In Salesforce Experience Cloud Explained | Salesforce Communities
A permission set is a collection of settings and permissions that give users access to various tools and functions. Permission sets extend users' functional access…
Deploy Lightning Web Component Files | Salesforce Lightning Tutorial
Learning Objectives After watching this video, you’ll be able to: Configure Lightning web component files for display in an org. Deploy your files to an…
Top 3 Interview Tips | How To Land A Salesforce Job
In this video, brad discusses the TOP 3 ways to nail your interview and land a job as a Salesforce Professional. These tips apply to…