Could you please someone let me know more about WITH and when its used as I came to know about it recently. I know WHERE and when and how its used. But when exactly WITH is used when compared to WHERE. Whether WITH can be used for all Std & Custom Object Fields.

I got something from below link but not able to find a usecase on it. If someone can explain it with an example that will be great.

Filters used in SOQL


The Force.com SOQL and SOSL Reference is quite clear on the constraints of the WITH filter expression:

The WITH clause can only be used in the following cases:

So unless you are querying the UserProfileFeed object, it is only usable for data categories.

| improve this answer | |

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.