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
Natraj Subramani 15Natraj Subramani 15 

searchResults class Query

Hi All,

We have a custom search configured on case object which uses the searchresults class to look for the value entered by user in certain fields.

Search.searchResults searchResults = search.find('FIND "string in ALL FIELDS RETURNING case(id,number......where record type Id=:recid)');

When I enter last 5 characters of the case  number, results dont come up but when I enter 6 charcters it comes up. Is there any pattern how this search works ? Can any one explain ?

Thanks
Natraj
Ramesh DRamesh D
Hi Natraj,
You need to use WILDCard Search to get your results with 5characters to work.
 
like this
FIND {My*}

Please follow below link 
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_sosl_find.htm

Thanks
Ramesh

*Please mark this as best answer if it was helpful*