function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
List<Lead> leads = new List<Lead>(); List<Contact> contacts = new List<Contact>(); List<List<SObject>> searchList = [FIND 'abc@gmail.com' IN Email FIELDS RETURNING Lead(FirstName, LastName), Contact(Name)]; for(List<SObject> sobjList: searchList) { if(sobjList.get(0).getSObjectType() == Schema.Lead.getSObjectType()) leads = sobjList; if(sobjList.get(0).getSObjectType() == Schema.Contact.getSObjectType()) contacts = sobjList; } system.debug(leads); if(!leads.isEmpty()) { //Your Code Here } system.debug(contacts); if(!contacts.isEmpty()) { //Your Code Here }
I hope this will help you
Here is the SOSL for above requirement
FIND {abc@gmail.com} IN EMAIL FIELDS RETURNING Lead(FirstName, LastName), Contact(Name)
Thank You,
Prasanthi
I would like to request selecting one best answer so this question shows up as resolved. Thanks.