function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abhishek Sharma 194Abhishek Sharma 194 

trailhead developer console basic 5 error

Challenge Not yet complete... here's what's wrong: 
Could not find the contact's name in the debug log. Be sure to run a query for your record, and to write your contact's name to the debug log using the System.debug() method.

I have this error in this unit any help would be great.

Thanks in advance.
Best Answer chosen by Abhishek Sharma 194
v varaprasadv varaprasad
Then click on complete trailhead.

All Answers

v varaprasadv varaprasad
Hi Abhishek,

Please execute below code in the anonymous window in a developer console : 
 
List<List<sObject>> searchList = [FIND 'Mission Control' IN ALL FIELDS 
                                  RETURNING Contact(FirstName, LastName,
                                  Phone, Email, Description)];

Contact[] searchContacts = (Contact[])searchList[0];

System.debug(searchContacts[0].LastName + ', ' + searchContacts[0].FirstName);
Hope this helps.
If above answer helps you please mark it as the best answer.

Thanks
Varaprasad

 
v varaprasadv varaprasad
Then click on complete trailhead.
This was selected as the best answer
Abhishek Sharma 194Abhishek Sharma 194
Thanks v varaprasad for help
v varaprasadv varaprasad
Hi Abhishek,

If above information helps and informative.Please mark it as the best answer.So it will remove from unresolved questions.

Thanks
Varaprasad