I have a Visualforce page in a Community that displays a users Case Details to them for their Case.
The page is using standardController="Case"
I am trying to get the list of attached knowledge articles from a Case w/o using <apex:relatedList list="CaseArticles"/>
The closest code I have come up with so far is:
public class CaseArticlesExtension {
public Id RecordId { get; set; }
public CaseArticlesExtension(ApexPages.StandardController stdController) {
RecordId = stdController.getId();
}
public KnowledgeArticleVersion[] getArticles() {
KnowledgeArticleVersion[] Articles = [SELECT Id, KnowledgeArticleId, UrlName, Title, Summary, LastPublishedDate, ArticleType
FROM KnowledgeArticleVersion
WHERE PublishStatus= 'Online'
AND Language = 'en_US'
AND KnowledgeArticleId IN :[SELECT KnowledgeArticleId FROM CaseArticle WHERE CaseId = :RecordId]];
return Articles;
}
}
This code has an error of "Invalid bind expression type of CaseArticle does not match domain of foreign key"