Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
All errors
SOQL

INVALID_FIELD: <field> is not filterable

You used a field in `WHERE`, `ORDER BY`, or `GROUP BY` that the platform refuses to filter or sort on — almost always a Long Text Area, Rich Text, or Encrypted field. The fix is either using a different field for the filter, or moving to SOSL for text searches.

Also seen asfield is not filterable·field is not sortable·INVALID_FIELD: is not filterable·Field cannot be used in a WHERE

Salesforce indexes most fields for filtering, but not all. Some are deliberately excluded: long text, rich text, encrypted, and a few standard fields. SOQL refuses to filter on these because the underlying storage isn't indexed in a way SOQL can scan efficiently.

The non-filterable field types

Field typeFilter?Sort?Notes
Long Text AreaUse SOSL FIND for text search
Rich Text AreaSame — use SOSL
Encrypted❌ (mostly)Some encryption types allow = only
Multi-Select PicklistPartialOnly INCLUDES/EXCLUDES operators
Geolocation❌ direct❌ directUse DISTANCE() for geo queries
Body on AttachmentBinary content, can't be queried

Plus a few standard fields like Account.LastViewedDate and Account.LastReferencedDate that the platform does index for filtering but not for ORDER BY performance reasons.

What works instead

For long-text fields, use SOSL

// ❌ SOQL on a Long Text Area
List<Case> hits = [SELECT Id FROM Case WHERE Description LIKE '%urgent%'];   // INVALID_FIELD

// ✅ SOSL searches the indexed text
List<List<SObject>> results = [FIND 'urgent' IN ALL FIELDS RETURNING Case(Id, Subject)];
List<Case> hits = (List<Case>) results[0];

SOSL hits a different index that's optimized for full-text search. Don't try to make SOQL work for it.

For multi-select picklists

Use the dedicated operators:

SELECT Id FROM Account WHERE Industries__c INCLUDES ('Tech', 'Manufacturing')
SELECT Id FROM Account WHERE Industries__c EXCLUDES ('Retail')

= and LIKE don't work on multi-select picklists. The platform treats them as semicolon-separated stored strings, but SOQL exposes only INCLUDES/EXCLUDES.

For geolocation

SELECT Id, Name, Location__c FROM Warehouse__c
WHERE DISTANCE(Location__c, GEOLOCATION(37.7749, -122.4194), 'mi') < 50

DISTANCE() is the only way to filter on geolocation; you can't filter on the underlying lat/long components individually.

When the message names a field that should work

Some standard fields become non-filterable in specific contexts:

  • User.Username is filterable, but User.Locale and User.LanguageLocaleKey aren't filterable in some queries.
  • Account.LastActivityDate is filterable but Account.LastModifiedDate only when you don't combine with certain joins.

The error message names the specific field — that's the constraint to look up in the platform docs. If the field really should be filterable per docs, file a Salesforce support case; some non-filterable flags have been bug-fixed over time.

A workaround: indexed companion fields

If you legitimately need to filter on a long-text field's content, create a shadow custom field of type Text (255) that stores a normalised excerpt or a category derived from the long text. Maintain it via a trigger or flow on save. Filter on the shadow field; display the original.

This is ugly but works in cases where the platform's "use SOSL" answer doesn't fit (e.g., a recurring report that needs to filter on text).

Related dictionary terms