Can anyone explain what is meant by this statement:

The RETURNING clause is optional via the API, but required via Apex code.

SOSL Reference

All I see from the docs is that the returning clause is optional.

1 Answer 1


Apex Code requires it to reduce the amount of resources used by the SOSL call. It is optional for the API; in that case, it returns all instances found across all objects within the limits.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .