-
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
How to Connect Salesforce Order Management System with Your B2C Commerce Storefront
What do you think your customers want from you? Only your products or services? Well, no! Nowadays, customers want a seamless buying experience, from adding…
10 Must-Have Features of Salesforce Marketing Cloud for Marketers
In today's fast-paced digital landscape, effective marketing strategies are crucial for businesses to stay ahead of the competition. Salesforce Marketing Cloud is a comprehensive platform…
Popular Salesforce Videos
Why Users Cannot be Deleted from Salesforce | How to Delete User from Salesforce?
Why users cannot be deleted from Salesforce and how to delete users from Salesforce? Watch this video and learn all about it. Do let us…
Salesforce CPQ Product Bundles
Salesforce CPQ product bundles. See how product bundles work with features and options. Also including an option constraint to prevent incorrect configuration. Watch this video…
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…