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
Srilakshmi B SSrilakshmi B S 

Searching Salesforce Tags via SOSL

I am trying to search the records based on AccountTag through sosl as below:

String searchQuery = 'FIND \'' + searchStr + '\' IN NAME FIELDS RETURNING  AccountTag (ItemId), Resource_List__Tag(ItemId)';

List<List <sObject>> searchList = search.query(searchQuery);

But getting the below error on execution:

AccountTag does not support search.

How can I search AccountTag using sosl?

 
pconpcon
There is nothing you can do to seach it.  The metadata for the AccountTag object does not allow for searching.  Your other alternative would be to use SOQL's wildcard features [1] with LIKE, but there are some limitations around it.

[1] https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_comparisonoperators.htm