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<List<SObject>> searchList = [FIND 'map*' IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Lead];
Account [] accounts = ((List<Account>)searchList[0]);
Contact [] contacts = ((List<Contact>)searchList[1]);
Opportunity [] opportunities = ((List<Opportunity>)searchList[2]);
Lead [] leads = ((List<Lead>)searchList[3]);
Note - picklist fields are not searchable with SOSL.
Mark this as the "Best Answer" if it resolved your query.
Thanks & Regards,
Akashdeep Arora
Twitter - @akashdeeparora1
Following is the idea I got.
Since the following result returns list of sObject list
((Account:{Name=Grand Hotels & Resorts Ltd, Id=0017F00000QKjHKQA1}), (Opportunity:{Name=Grand Hotels Guest Portable Generators, Id=0067F000008KxonQAC}, Opportunity:{Name=Grand Hotels SLA, Id=0067F000008Kxp6QAC}, Opportunity:{Name=Grand Hotels Generator Installations, Id=0067F000008KxoyQAC}, Opportunity:{Name=Grand Hotels Emergency Generators, Id=0067F000008Kxp8QAC}, Opportunity:{Name=Grand Hotels Kitchen Generator, Id=0067F000008KxokQAC}))