kushal33

apex access list first element data

Sep 13th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. List<List<SObject>> searchList = [FIND 'rose' IN ALL FIELDS RETURNING Account(Name), Contact(FirstName,LastName,Department)];
  2. System.debug('searchList===> '+searchList[1]);
  3. Contact [] searchedInvoice = (List<Contact>)searchList[1];
  4. Contact con = ((List<Contact>)searchedInvoice)[0];
  5. System.debug('searchedInvoice===> '+((List<Contact>)searchedInvoice)[0]);
  6. System.debug('con===> '+con.firstName);
Add Comment
Please, Sign In to add comment