1

I have a Visualforce page where I have few fields coming from Cases. I need to have Knowledge Articles related list on the page for the Case.

I cannot use Apex:detail tag as I need only specific fields on the page to be displayed.

Any solution for the above scenario??

Thanks in advance Raj

1
  • Did you already try something ? you can query data and use a number of visualforce tags to display data the way you like. Commented Feb 11, 2014 at 9:40

1 Answer 1

2

Assuming you are using the Case standard controller you should simply be able to use an apex:relatedList tag on your Visualforce page.

<apex:page standardController="Case">
    <apex:relatedList list="CaseArticles"/>
</apex:page>

If you're not using the standard controller then you'll have to define the subject attribute for this to work.

Controller:

public class MyController 
{
    private final Case aCase;

    public MyController() {
        aCase = [SELECT Id FROM Case 
                   WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
    }

    public Case getCase() 
    {
        return aCase;
    }
}

Visualforce Page:

<apex:page controller="MyController">
    <apex:relatedList subject="{!Case}" list="CaseArticles"/>
</apex:page>

See here for more information on the apex:relatedList tag: http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_relatedList.htm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .