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
sharrissharris 

Solution Categories in SQOL Query

Hi There,

 

I am trying to fill a PageBlockTable with some Solution records but I need to include the Selected Solution Category. I realize that this is a one to many relationship from Solution to Category an that there is a Junction object called CategoryData that in turn links to CategoryNode for the Category name. How can I link to this with a SQOL query? Here's my attempt:

 

public PageReference doSearch()
{
    sql = 'SELECT Id, SolutionNumber, SolutionName, TimesUsed, CategoryData__r.CategoryNode__r.MasterLabel FROM Solution WHERE (SolutionName LIKE \'test'%\'')';
    List<sObject> L = Database.query(sql);
    return null;
}

 

 

I get this error:

 

Visualforce Error

System.QueryException: Didn't understand relationship 'CategoryData__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. 

 

Thank you!

sharrissharris

Does anyone out there have experience with working with Solution Categories? Thank you.

benito dardobenito dardo

Did you find a solution ?