-
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
Getting Started with Salesforce Lightning Scheduler
If scheduling appointments is a consistent problem in your business, or you need to upscale your current system, try the Salesforce Lightning Scheduler. This add-on…
Close Case Button in Lightning Experience - Workaround
If you have Used Cases in Salesforce, I am sure you’re aware of the Closed Case layout. This is great, it lets you require the…
Top Salesforce Service Cloud Einstein Features For B2B Business
The Salesforce CRM platform is the world leader in customer relationship management and doesn't stop at optimizing its performance. It is a powerful service that…
Popular Salesforce Videos
Step-by-Step Guide to Implementing Einstein Chatbot in Salesforce
Watch this video to learn about the following: Introduction to Einstein Chatbot and its capabilities. Prerequisites for setting up the chatbot in your Salesforce environment.…
Salesforce User Experience UX Designer Certification
The Salesforce User Experience (UX) c is designed for individuals who have at least 6 months in UX design and 3–6 months’ experience utilizing UX…
Welcome to the New World of Data Collection | Salesforce | Summer Internship
Secure data collection built for your needs. With FormAssembly, your organization can streamline outdated processes and power important business initiatives. To enroll Contact us +91…