function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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);