

Salesforce has limited support for “Search” functionality. Users can only search values stored in the text fields/controls. Salesforce users cannot search values in Multi-Select objects as it is not supported. Multi-Select values are stored as text strings separated by semicolons in the database. The majority of the business savvy customers want to search on all/any field on the screen.
A suggested workaround for search is to create a text field behind the scene to store each of the searchable values, to make it searchable by the Salesforce application.
Instead of creating multiple text fields to store data, it is optimal to use JSON format to store all the content in a single text field.
· Create a new Custom Formula field which returns a text value.
· Use the following apex code to populate the Created field.
| for (related object c : newRecords) { c.JSon_Text__c=JSON.serialize(c).left(100000); } |
· The New text field will have all the fields of that related object with their values in json format.
This solution is scalable and JSON objects writes all the values in the fields on the Salesforce page. One need not have to add each field/values separately, Doesn’t impact much on performance, easy to implement, easy to migrate.
All the values becomes searchable, Sometimes search picks up the records which has substring “and” , “new” etc. Take note that since lookup fields are stored in the form of id hence it is not searchable.
Enjoy enhanced security with broker vetting, encrypted transactions, and regulatory compliance Nuage Boosttide platform
All fields including date, picklist, multi-picklist fields become searchable using this approach.