0

I'm trying to play around with SOSL and was wondering is it possible to look for record ID's using SOSL?

I tried

FIND {0D56F0000DPRLnKSQX} IN ALL FIELDS RETURNING FeedItem(id,body)

But it comes back with no records

Thank you

2 Answers 2

3

Not really, and if you could you probably wouldn't want to.

You could make it work by copying the record Id to a text field using something like a before-save record triggered flow, but at that point you're really better off just writing a SOQL query instead.

SOSL is meant to search text fields (Name/Subject/Title/etc..., email fields, phone fields) where you know that some text exists, but not necessarily which field(s) or object(s) they exist in.

The governor limit on SOSL queries is even stricter (20) than the one for SOQL queries (100).

2

The SOSL documentation is pretty explicit:

You can search text, email, and phone fields

Id fields are none of the above.

If the ID existed inside a text string (such as a text area long field where you are logging stuff), then that record would be found

You must log in to answer this question.

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