Explanation: A developer should use the FIND clause with the IN Name Fields option to obtain the Id and Name of all the Leads, Accounts, and Contacts that have the company name “Universal Containers”. The FIND clause allows you to perform text searches in Salesforce data, similar to searching with a search engine1. The IN Name Fields option specifies that the search should look for matches in the Name fields of the objects2. The RETURNING clause specifies which objects and fields to return in the search results3. The syntax of the FIND clause is as follows:
FIND {searchString} [IN searchGroup] [RETURNING fieldSpec [ORDER BY orderBySpec] [LIMIT limitSpec] [OFFSET offsetSpec]]
For example, the following query returns the Id and Name of all the Leads, Accounts, and Contacts that have the company name “Universal Containers”:
FIND ‘Universal Containers’ IN Name Fields RETURNING lead(id, name), account(id, name), contact(id, name)
Option B is incorrect, because there is no such option as IN CompanyName Fields in the FIND clause. The valid options for the IN clause are ALL FIELDS, NAME FIELDS, EMAIL FIELDS, PHONE FIELDS, and SIDEBAR FIELDS2.
Option C is incorrect, because it is not a valid SOQL query. SOQL stands for Salesforce Object Query Language, which is a different way of querying Salesforce data than the FIND clause. SOQL queries use the SELECT statement to specify the fields and objects to retrieve, and the WHERE clause to filter the records based on certain criteria. However, SOQL queries cannot query multiple objects in a single statement, unless they are related by a relationship. Therefore, the query in option C would result in a syntax error, as it tries to query Lead, Account, and Contact objects in the same statement, without specifying any relationship.
Option D is incorrect, because it is also not a valid SOQL query. Apart from the same issue as option C, it also has a typo in the WHERE clause, as it uses an asterisk (*) instead of an equal sign (=) to compare the CompanyName field with the value “Universal Containers”.
References:
- FIND | SOQL and SOSL Reference | Salesforce Developers
- IN | SOQL and SOSL Reference | Salesforce Developers
- RETURNING | SOQL and SOSL Reference | Salesforce Developers
- [Salesforce Object Query Language (SOQL) | SOQL and SOSL Reference | Salesforce Developers]
- [Relationship Queries | SOQL and SOSL Reference | Salesforce Developers]