• N M Kalesha Vali 7
  • NEWBIE
  • 25 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi guys,

Need your help with this. How do I display the contact's Firstname, Lastname and Department if I have this query. Any help would be greatly appreciated. =)

List<Account> acctsWithContacts = [SELECT Name, (SELECT FirstName, LastName, Department FROM Contacts)
                                    FROM Account
                                    LIMIT 2];

for(Account cts : acctsWithContacts) {
    System.debug('Account Name: ' + cts.Name);
    System.debug('Contact Name: ' + cts.Contacts.FirstName + cts.Contacts.LastName);
    System.debug('Contact Department: ' + cts.Contacts.Department);
}
Hi all,

I am having an issue/error with above trailhead badge 3rd unit and the error is as shown below.  Even after verification of the quick actions applied to the selected list, the same error pops up.

Challenge Not yet complete... here's what's wrong:
One or more of the quick actions were not added to 'Field Sales App'


Thanks in advance.

With regards,
Kalesha Vali
Hi all,

I am having an issue/error with above trailhead badge 3rd unit and the error is as shown below.  Even after verification of the quick actions applied to the selected list, the same error pops up.

Challenge Not yet complete... here's what's wrong:
One or more of the quick actions were not added to 'Field Sales App'


Thanks in advance.

With regards,
Kalesha Vali

I want to make report some object using linked object information.

Could anyone give me advie or good reference for that?

Hi guys,

Need your help with this. How do I display the contact's Firstname, Lastname and Department if I have this query. Any help would be greatly appreciated. =)

List<Account> acctsWithContacts = [SELECT Name, (SELECT FirstName, LastName, Department FROM Contacts)
                                    FROM Account
                                    LIMIT 2];

for(Account cts : acctsWithContacts) {
    System.debug('Account Name: ' + cts.Name);
    System.debug('Contact Name: ' + cts.Contacts.FirstName + cts.Contacts.LastName);
    System.debug('Contact Department: ' + cts.Contacts.Department);
}