3

My org has Classic encryption and I have a encrypted field in contact object. I am trying to use that field in SOSL.

FIND {123456789} IN ALL FIELDS RETURNING CONTACT(NAME)

This is returning 0 results even though I have populated this field as 123456789 in one of the contact records.

3
  • what type of field is it?
    – glls
    Dec 5, 2017 at 17:34
  • 1
    This is a text(Encrypted) field and Mask Type as Social Security Number.I am able to see the value in record page as I have view encrypted data permission
    – devforce
    Dec 5, 2017 at 17:36
  • consider accepting the answer below if it helped answer your question. Cheers!
    – glls
    Jan 3, 2018 at 15:16

1 Answer 1

3

Assuming your field is a custom encrypted field, SOSL only supports the following:

All custom fields of type text, text area, long text area, rich text area, email, and phone

You can check the searchable fields documentation for Contact.

Based on the above, it is normal that SOSL does not return any results. I had a similar question in the past regarding SOSL on pick list fields on the Case Object here.

For the record, text(Encrypted) is not the same as text, hence, not queryable with SOSL.

When Using Shield Platform Encryption,

There are certain considerations when using SOSL and SOQL:

Encrypted fields can’t be used with the following SOQL and SOSL clauses and functions:

-Aggregate functions such as MAX(), MIN(), and COUNT_DISTINCT() WHERE clause

-GROUP BY clause

-ORDER BY clause

2
  • 1
    So there is no way to search on Text(encrypted) fcustom ields other than making that field type to Text? Will Text(encrypted) custom fields work with Shield Platform Encryption rather than
    – devforce
    Dec 5, 2017 at 18:10
  • I just linked the doc and udpated my answer for that.
    – glls
    Dec 5, 2017 at 18:41

You must log in to answer this question.

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