We have a requirement to display the list of cases that are related to an article in a service console sidebar when viewing a case that has an article associated to it. In other words, I have a current case I am working with and I associated an article to the current case in context. It would be nice to see list of cases that are associated to the same article in context of current case in the left sidebar of the service console (case detail or case feed view). Support indicated that this is not an OOB feature. So I am trying to create a apex class and then create a VF page to display the list of cases on the left side bar of the console. While creating the apex I am getting the folloiwng error . Can some help provide feed back on what the isue might be?
[Error] Error: Compile Error: Illegal assignment from List to Case at line 16 column 5
Here is the code
public class CaseArticleExtension {
public final Case thisCase;
public String CaseId {get;set;}
public String KnowledgeArticleId {get;set;}
public Case selectedCase {get;set;}
public CaseArticleExtension(ApexPages.StandardController stdController) {
this.thisCase = (Case)stdController.getRecord();
selectedCase = new Case();
}
public pagereference CaseArticle(){
selectedCase = [SELECT CaseId FROM CaseArticle WHERE KnowledgeArticleId = :KnowledgeArticleId];
return apexpages.currentpage();
}
}
VF Page:
<apex:page standardController="CaseArticle" extensions="CaseArticleExtension" >
<apex:form >
<span>Case Number:</span>
<apex:inputText value="{!ArticleId}"/>
<apex:commandButton value="Search" action="{!CaseArticle}"/>
</apex:form>
</apex:page>