The challenge:
http://trailhead.salesforce.com/content/learn/modules/apex_database/apex_database_soslpublic class ContactAndLeadSearch{
public static List<List<sObject>> searchContactsAndLeads(String searchString){
List<List<sObject>> queryResult = [FIND :searchString IN ALL FIELDS RETURNING Contact(Id where LastName=:searchString Order By Name), Lead(Id where LastName=:searchString Order By Name)];
Contact[] contacts = (Contact[])queryResult[0];
Lead[] leads = (Lead[])queryResult[1];
return queryResult;
}
}
it still fails when i add name and lastName to the SOSL result, i even tried making a List<List<sObject>> containing both the Contact and Lead list and it still failed. Help please
#Trailhead Challenges
2 个回答
Hi ,
Please check this article.
https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4I14SAF