0

Seems like Salesforce wont allow me to sort articles by caseassociation count as the parent. Any ideas how I can accomplish this?

SOSL

FIND {*searchTerms*} RETURNING KnowledgeArticleVersion
    (Id, Title, ArticleType WHERE PublishStatus='online' AND Language = 'en_US' AND ArticleType IN ('Troubleshooting__kav', 'How_To__kav', 'FAQ__kav') **ORDER BY KnowledgeArticle.CaseAssociationCount DESC**)
    WITH DATA CATEGORY Topics__c AT *Category*

Error

'How_To__kav', 'FAQ__kav') ORDER BY KnowledgeArticle.CaseAssociationCount__r)
                                    ^
ERROR at Row:2:Column:161
Didn't understand relationship 'KnowledgeArticle' 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.
2
  • I don't think you can traverse the relationship from KAV to KA...I just tried in Eclipse and it won't let you, it'll only do it for the KA.Id. The only other way I can think of is a wrapper class and a Map of KnowledgeArticles. – Girbot Mar 30 '16 at 16:32
  • Would you be able to provide an example of how the class should be written? – Allen Mann Mar 31 '16 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.