• chiranjeevi tulugu
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
One of the challenges was to return names from leads and contacts. 
Code looks like this:
public class ContactAndLeadSearch {
    public static List<List<SObject>> searchContactsAndLeads(String FindName)
    {
        list<list<sObject>> ReturnName = [find :FindName IN ALL FIELDS Returning lead(FirstName, LastName), contact(firstname, lastname)];
        
        return ReturnName;
    }
}
When looking at the return ReturnName, how can you determine from what object the First/Last Name was retrieved? Lead?Contact?
Other examples used the  [0] and [1] in their examples when they were traversing multiple object but they only had one "find" in each object. 
Just curious as I do  understand the [x][y] notation in list<list> concepts.