-
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 Service Cloud - An Introduction
Service Cloud This portion of the Salesforce stage is centered on giving back and offering assistance to the clients. This makes a difference in holding…
From Discovery to Design: Creating Seamless User Experiences in Salesforce
Introduction User experience (UX) plays a major role when implementing Salesforce, as it has a significant impact on user satisfaction and adoption rate which, in…
5 Things You Need to Know about Salesforce Commerce Cloud
Salesforce Commerce Cloud, formerly known as Demandware, is a robust and scalable cloud-based platform designed to empower businesses with advanced e-commerce capabilities. As an industry-leading…
Popular Salesforce Videos
Apex Classes and Apex Triggers in Salesforce
In this video, Salesforce developer Artem will demonstrate real-world applications of both Apex classes and triggers with practical business scenarios. Apex classes and Apex triggers…
What is Lookup Relationship in Salesforce?
In this video, Shrey is not only teaching but also demonstrating to you "What is Lookup Relationship in Salesforce?". You will be learning: 1. How…
Is The Salesforce Job Market Saturated? | The Facts
You may have heard that the Salesforce job market is saturated, however there is no evidence to indicate this, in fact it’s the exact opposite!…