Default Return Type of a SOSL Statement

SOSL Return Type

Question

What is the default return type of a sosl statement?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.

The default return type of a SOQL statement is not listed as an option in the given answers, but the default return type of a SOSL (Salesforce Object Search Language) statement is a List of Lists of sObjects.

SOSL is used to search records in Salesforce across multiple objects, which can be useful in situations where you need to search for specific keywords or phrases in multiple objects. The result of a SOSL statement is always a list of lists of sObjects, where each list of sObjects represents the records retrieved from a particular object.

For example, if you use a SOSL statement to search for the keyword "Acme" across the Account and Contact objects, the result will be a list of two lists of sObjects - one list containing the matching Account records, and another list containing the matching Contact records.

It is important to note that you can specify a different return type for a SOSL statement by using the RETURNING clause in your query. This allows you to return different types of data, such as AggregateResult objects or custom objects, depending on your specific needs.