-
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
7 Tips to Boost Productivity with Salesforce Insurance Solutions
Salesforce for insurance companies is a powerful tool for managing your business. However, it's not always easy to use or understand the implications of using…
Salesforce Sales Cloud and Service Cloud: A Successful Binomial
Sales Cloud and Service Cloud are two of the most used Salesforce products. Do you know what each of them consists of? Here you can…
How the Salesforce1 Mobile App Can Help Businesses
To understand “how the Salesforce1 mobile app can help the business”, we must first understand the how and the difference between Salesforce and Salesforce1. The…
Popular Salesforce Videos
Salesforce enthusiasts welcomes you to the Trailhead! Skill up for the future.
A trailhead is defined as an outdoor space that is designated by an entity responsible for administering or maintaining a trail to serve as an…
Salesforce Flow Best Practices: Salesforce Flow Design Patterns
Salesforce Flow Design Patterns from Fundamentals to Mastery. In this session, we will talk about the top 10 Salesforce Flow best practices. We will talk…
Get Together Safely with Salesforce Safety Cloud
Learn how Safety Cloud helps people get together in person, safely. Safety Cloud helps businesses and communities better manage their testing, health and entry protocols…