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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.