function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DT DeveloperDT Developer 

Searching a Text Area (Long)

Is there a way in Salesforce to have the ability to Search a Text Area (Long) field type?  We have a string that comes in from our website that contains 3 letter codes that are seperated a ; and ranges from 4 to 2000 charectors.  Only solution we can come up with is to either seperate the field into 8 - 10 Text Area fields or create around 500 check boxes 1 for each code.
Thanks in advance.
Best Answer chosen by Admin (Salesforce Developers) 
This page says that the search scope includes textarea fields unless you're using the IN ALL FIELDS modifier.

All Answers

Have you tried a SOSL search?  I believe (but I'm not certain) that it indexes long text areas.
Ron WildRon Wild
Could someone confirm this for me?  Does SOSL search long text areas?

I've done a couple of tests, but haven't had any success yet.




I have the same question. Get any answers? 




This page says that the search scope includes textarea fields unless you're using the IN ALL FIELDS modifier.
This was selected as the best answer

Thanks werewolf,


Maybe you have a typo there... the search() method looks in text area when you do sepcify "in all fields".  And for those of you who are curious the search is case insensitive. I verified both these things.






This idea says that it will only search the first 1000 characters. Can anyone confirm that this is true?





I created an object in salesforce and it has 2 long text fields. I am implementing a form on our website to enter data and submit. It creates the record in salesforce. But, when I try to implement the search functionality and want to return a record if the keyword matches in those long text fields it fails.


For example: Auditor_Name__c LIKE '%practice%' OR Criteria__c LIKE '%practice%'  here Critieria__c is the long text field. My query breaks and it doesn't return any record. It returns a record if the keyword is in the Text field.


On the other hand, salesforce global search functionality works just fine. Why can't the API use the same attributes of the field. 


I am really stuck. Can anyone help me.


Thanks a lot.


Miguel Angel Bravo Sanz 5Miguel Angel Bravo Sanz 5

Hi, I checked it with Textarea, Textarea Long and Textarea RIch and the FIND is working fine for these kind of fields.

Mars Rover 1084Mars Rover 1084
Yes, Text Area fields can be searched through SOSL. But the challenges we face are, you will never get the fullset of records in one query.
Limitations : 
1. Max resultset size is 2000 records.
2. Only the results that are indexed will be in resutset. ie. 
      Imagine you have got 1900 records matching the criteria.
      What salesforce dose is indexes few records (per say 500), which records and at what time is unknown.
      Now when you query youll see only 500 records. 
      Now when SF reindexes more records the new records matching the criteria would result.
      You may be surpriesed, how come the same query executed to two different instance in time would result in more or less records.
      Provided there is no data change matching the criteria during this time.
Conclusion : This behaviour would not let you define a full resultset in one go.

I am looking for any suggesstions, to SOQL or SOSL or anymeans to get the resultset matching the creteria for a LONG TEXT AREA FIELD.

Salesforce consideraions : (