-
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
Why Financial Institutions Are Choosing Salesforce for Smarter Client Relationships
In today’s competitive financial landscape, client relationships are at the heart of business growth. Financial institutions need a system that helps them understand client needs,…
Opportunity Line Item | Salesforce Developer Guide
An opportunity is a pending agreement with a monetary value attached to it. It denotes that if the Opportunity is closed successfully, the $ amount…
How to Set Up a Salesforce Jira Integration [Step-by-Step Guide]
Salesforce and Jira are the two most popular business tools that are used to increase business productivity and efficiency. While Salesforce provides a 360-degree view…
Popular Salesforce Videos
1st Year as a Salesforce Business Analyst
If you are interested in a Salesforce Career, check out Talent Stacker. This is what I used when I first started and ended up joining…
Rollup Trigger via Salesforce Record Triggered Flow - Trigger without code
Hello Folks, I created a Rollup trigger via Salesforce Record Triggered Flow (without code cool isn't). I use Record trigger Flow for that scenario. There…
4 Salesforce Report Formulas To Enhance Your Sales Process
Salesforce is a highly effective tool that can help businesses manage their customer relationships and sales processes. In this video, you will learn 4 helpful…