You need to sign in to do that
Don't have an account?
Any way to show articles attached to case on custom VF page for portal user?
I have custom VF pages to display Case data for customer portal users, and I need to display the Articles (as in Salesforce Knowledge articles) attached to the case. Articles can be displayed similar to a related list on standard page layouts, but I can't use those since all my pages are custom VF pages.
I thought I could use the "support:caseArticles" VF element, but it's displaying nothing for the customer portal user, no matter what options I use (and I am setting the caseId parameter). I know the portal user has access to an attached article because he can see it in the "Articles" tab, and the article is enabled for access via the Customer Portal channel.
Is there something I'm missing? Isn't this the purpose of the "support:caseArticles" element, to display attached articles to a case (and an optional search, but I don't care about the search part). I did find the requirement to enable both Knowledge and Case Feed, which I did (the VF editor wouldn't even let me save the page until I'd enabled Case Feed).
Thanks
You can add a related list to a visualoforce page using the <apex:relatedList list="ListName"/>
@izay
There are some objects that you can add as a Related List on a standard page layout, but they cannot be added to custom VF pages using the "apex:relatedList" element. Three of them I know of are Case Comments, Notes/Attachments, and Articles. All of these give errors when trying to use them in a VF "apex:relatedList" element.
I had to display (and allow users to add) Case Comments on my VF pages using custom queries and methods.
Because Articles are even more convoluted with how they're stored on the back end, I was hoping I could use the VF "support:caseArticles" element, but it's not working.
In your visualforce page controller/extension you can query the KnowledgeArticleVersion object like so:
Then display the articles in a <apex:PageBlockTable>
@izay
Thanks so much! I just started dumping all the contents of various Knowledge-related objects (using the Apex data loader) to see how things were tied together on the back end. I also used a PageBlockTable to display case comments, so this gives me a good (and similar) starting point.
Thanks!