« Salesforce Security Model | Main | Lightning Inspector Updates »

SOSL WITH HIGHLIGHTING (part of Spring '17)

I'm super excited about this update being released as part of Salesforce Spring '17 (works in both SOAP/REST API 39). I've been testing it out in my sandbox. Below is a simple example of the syntax:

FIND {salesforce} IN ALL FIELDS RETURNING Lead (Company, Description) WITH HIGHLIGHT

This functionality works on the following fields types (as of right now):


  • Email
  • Text
  • Text Area
  • Text Area (Long)


You can run this simple example in the Developer console and see that it returns the results with the <mark> tag around the term.

With this functionality, it is now pretty easy to search through a lot of record data for very specific things and return back a nice highlighted list of the results without having to use or build some form of custom control.



PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
All HTML will be escaped. Hyperlinks will be created for URLs automatically.