+ Start a Discussion
bs881026bs881026 

SOSL for querying all email ids of gmail.com

Hi, Can anyone please let me know what will be the SOSL query for querying all email ids with gmail.com domain name.

Thanks.
AnjunaAnjuna
Hi,
Try this :
List<List<sObject>> searchList = [FIND '@gmail.com' IN EMAIL FIELDS
                   RETURNING Account(name),Contact(Email)];
system.debug('searchList=='+searchList);