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
Michael.WatkinsMichael.Watkins 

searching solutions by category

any ideas how one would mimic the portal search solution functionality by solution category?

oSearchResult = oProxy.search("find {" & searchString & "} in Solution fields returning Solution (Id, CreatedDate, LastModifiedDate, SolutionName)")

the only thing i can think of is to search solutions as referenced above, and then loop thru the categorydata by RelatedSobjectId after-the-fact with additional calls. the downside is this would burn several api calls and seems a backwards approach to what i need-

which is something like:
SELECT ID, SolutionName, LastModifiedDate, cn.MasterLabel FROM Solution s
INNER JOIN CategoryData c ON c.RelatedSobjectId=s.ID
INNER JOIN CategoryNode cn ON cn.
ParentId=c.CategoryNodeId
WHERE cn.MasterLabel='[Desired_CategoryName_Filter]'

thanks-

HardhatHardhat

There's not much of a better way than pretty much what you've described -- do the SOSL search first, then filter to only the solutions in that match a given category using CategoryData.

If you want to avoid burning too many queries you could do this as an Apex webService method instead.  That would probably run significantly faster and it would cut it down to just 1 overall API hit per search.