Master the concepts of Salesforce in just 45 days Click here to know more.
8
10
58
27
Premium Salesforce Weekend Batch Start From Tomorrow.
Search Groups are basically used to define the type of fields in which you can search that text.
Search in Specific Fields:
If we want to return texts from a particular object then we use returning keyword.
Ex:
List<List<sObject>> results = [FIND ‘Univ*’ IN NAME FIELDS RETURNING Account, Contact];
List<Account> accounts = (List<Account>)results[0];
List<Contact> contacts = (List<Contact>)results[1];
If we want to search text in a particular field, we are going to use search group.
Find {contact} IN (searchgroup)
Find {contact} IN (searchgroup) returning objects & fields.
List<List<sObject>> results = [FIND ‘Univ*’ IN NAME FIELDS RETURNING
Account(Name, BillingCountry), Contact(FirstName, LastName)];
system.debug(accounts[0].Name);
Note: Return Type of SOSL is list of list of sObjects which is parent class of all Objects.
Note: In Apex use ‘ ’ instead of { }.
< < Previous
Next > >
The batch is going to start shortly. Fill the form given below to Register yourself now.
Fill out the form and get consulted by our Salesforce experts.
Fill out the form to figure out to detemine the perfect Salesforce profile for yourself.
Fill the form below to get a demo of this course.
Fill out the form to get your Premium Salesforce Development Course
Online Salesforce Development Course is soon going to be launched. Please fill the form and we will notify you about the course.