-
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
Here's All you need to Know About Asynchronous Apex in Salesforce
Apex offers multiple ways to run your Apex code asynchronously. This can save you time and help you keep your code more organized. Asynchronous apex…
Integrating Salesforce with Accounting Solutions
With work from home becoming the new normal, companies are leveraging cloud-based technologies to make it easier for teams to access information from multiple devices.…
5 Benefits of Salesforce Lightning App Development
In the ever-evolving landscape of business technology, staying ahead is not just an advantage—it's a necessity. Salesforce Lightning App Development has emerged as a pivotal…
Popular Salesforce Videos
Exploring Technology Choices For Salesforce Integration
Are you struggling to find the perfect technology to integrate Salesforce into your business processes? Integrating Salesforce into your business processes can offer significant advantages,…
GS DevOps Mate: Your Free Flexible Toolkit for Faster and Smoother Salesforce Deployments
Are you considering automated Salesforce deployments based on repos? Or are you struggling with setting up CI/CD utilizing SFDX on the CI/CD platform of your…
Salesforce Platform Quick Tip: How to Access Popular Items in a Single Click
Want to get to the things you use most with fewer clicks? Trailblazer and Senior Salesforce Developer, Ellie Matthewman shows us how to use favourites…