You need to sign in to do that
Don't have an account?
billgreenhaw
Relatedlist - CaseComments not working (Trying to make tabbedCases)
I am trying to made tabbedCases (like the example tabbedAccounts). Here is the code:
I get the error: 'CaseComments' is not a valid child relationship name for entity Case. This looks to be the correct name according to the WSDL.
Any thoughts?
Message Edited by billgreenhaw on 07-14-2008 02:18 PM
Code:
<apex:page standardController="Case" showHeader="true" tabStyle="case" > <style> .activeTab {background-color: #B7A752; color:white; background-image:none} .inactiveTab { background-color: lightgrey; color:black; background-image:none} </style> <apex:tabPanel switchType="client" selectedTab="name2" id="theTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab"> <apex:tab label="Detail" name="CaseDetails" id="tabdetails"> <apex:detail relatedList="true" title="true"/> </apex:tab> <apex:tab label="Open Activities" name="OpenActivities" id="tabOpenAct"> <apex:relatedList subject="{!case}" list="OpenActivities" /> </apex:tab> <apex:tab label="Activity History" name="ActivityHistory" id="tabActHis"> <apex:relatedList subject="{!case}" list="ActivityHistories" /> </apex:tab> <apex:tab label="Case Comments" name="CaseComments" id="tabCaseComments"> <apex:relatedList subject="{!case}" list="CaseComments" /> </apex:tab> </apex:tabPanel> </apex:page>
Any thoughts?
Message Edited by billgreenhaw on 07-14-2008 02:18 PM
Message Edited by TehNrd on 07-15-2008 03:45 PM
'CaseComments' is not a valid child relationship name for entity Case
Here is my Visualforce and associated controller extension:
<apex:page standardController="Case" extensions="ProjectControllerExt" >
<apex:relatedList list="CaseComments" />
</apex:page>
public with sharing class ProjectControllerExt {
public Case project { get; set; }
public ApexPages.StandardController con { get; set; }
public ProjectControllerExt(ApexPages.StandardController con) {
this.con = con;
this.project = (Case) con.getRecord();
}
}
Am I doing something wrong? Is anyone able to make this work?
I had the same problem and then I found this posting:
http://boards.developerforce.com/t5/Visualforce-Development/CaseComment-related-list/td-p/129629
It says that we need to manaully insert the code to display the case comments.
I do not like this soultion because we need to also create the code to enable normal actions such as edit and delete.
Notice how the Account example only shows related lists that are simple tables!
Another related problem dealing with Custom Objects and related lists is discussed here:
http://boards.developerforce.com/t5/Visualforce-Development/How-Do-You-Figure-Out-Related-List-Names/td-p/80645
It says that we need to make sure the custom objects related list is included on the default page layout.
Building custom apex code seems to be the only solution. I suppose this is because CaseComment and EmailMessage are objects themselves so they are more complex then a simple related list.
The above includes the code for the Edit action but it doesn't work if the user can not edit a given case comment (e.g. they did not create the comment or have modify all privledges on CaseComment). I'm looking for a solution to that problem. Specifically;
Does anyone know how to only render based on record level security (sometimes called row level security)?
I believe all that is required is to specify the "with sharing" keywords on your controller class definition.