-
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 Flow - A Brief Guide You Should Check
In today’s world we all want things to get done in less time, we all want speed. While handling a client, company wants to give…
What is Salesforce Integration and Its Architecture Types in 2024?
Salesforce Integration and Its Architecture Types Salesforce's integration combines two or more systems that allow users to streamline different processes. Every integration aims to ensure…
Build a Salesforce Lead Machine Easily
“There is a difference between — waiting for something good to happen and going all out to make it happen”. One of the biggest aspects…
Popular Salesforce Videos
Salesforce Spring ‘21 Release Notes Highlights & Summer ‘21 Preparation
Spring ‘21 Release Notes Highlights & Summer ‘21 Preparation In this session we discussed 00:00 Bella Vista, Western Sydney Developer Group Overview 03:30 Andrew Whitten…
A Must-Have for Admins: Salesforce Profiles, Permission Sets, and Roles Explained
Keeping your data safe and organized is a must-have. Luckily, Salesforce provides all the tools to help administrators control who can see and do what.…
Setting Up Service Territories and Operating Hours | Salesforce Webinar
Scale your business and ensure optimized performance by setting up service territories in Salesforce Field Service. In Salesforce Field Service, operating hours represent service territory…