You need to sign in to do that
Don't have an account?
MyGodItsCold
Can related list objects be filtered with criteria
When I see an Account detail screen, I'd like to be able to only show Contacts based on some kind of criteria.
Can this be done? Is there an override, or controller extension that could do it? Or, could it be done via security rights?
Thanks,
Can this be done? Is there an override, or controller extension that could do it? Or, could it be done via security rights?
Thanks,
SELECT Name, (SELECT Name FROM Contact WHERE Country = 'USA') FROM Account
It doesn't Save - the message is:
Error: Syntax Error. Missing '='
Here's the Page:
In MyAcctExt:
But this won't Save -
Error: Compile Error: unexpected token: name at line 5 column 69
I'm thinking I'm very close, but I have 1 fear described in the following 2 points:
1. I'm not sure the apex:relatedList tag will get a top of the page entry of the related list -
only as a section on the detail page proper - well, not exactly proper - just past the
very end - under the '^ Back to Top' and 'Always show me more related list records
per page' links at the bottom of the page when the apex:detail tag's relatedList
attribute is true.
2. Even setting apex:detail relatedList="true", I would have settled for a descriptive
name, like "Active Only Contacts" for my custom related list, but even that doesn't
get me the top of the page "Active Only Contacts (3)" kind of hot link which would
respond to hover pull down list.
Here is the code which saves, but when run, gives me:
Insufficient Privileges You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.
However, I'm the owner & I'm a system administrator.
Page:
Controller Extensions:
If I next set relatedList="false", I get the related list section at the bottom of the page.
I've got a feeling this is as good as it gets, but I'm hoping I'm wrong.
Thanks for all your help, I truly appreciate it.
More work but more flexible.
Using dataTable in Visualforce, the same knowledge could be shown, but the ListName(count) at the top of the screen with hover-over list display would not be there.
Did you ever get this one to work. I am trying to do some thing similar and is having issues. The error I am getting is insufficient privilages
Girish
I am trying to do something similar to this, like filtering the activities relatedlist for contact. can somebody let me know how to create a custom related list from a VF page. do I need to add the VF page in the page layout. my VF page looks similar to this
<apex:page standardController="contact" extensions="TouchpointController">
<apex:detail id="ChildOpps_v1" relatedList="true">
<apex:relatedList id="HistoryTasks" list="Task" title="History Activities" subject="{!HistoryActivities}">
</apex:relatedList>
</apex:detail>
</apex:page>
Please let me know how can I add a custom relatedlist to contact detail page.
Thanks in advance
YP.
Hi,
I am trying to implement the same. What I have observed is, when we want to show the related list, we can directly use a code like below:
<apex:page standardController="<custom object>" >
<apex:relatedList list="OpenActivities" title="custom related list" >
</apex:relatedList>
</apex:page>
But, when I try to customize the records being shown in related list by doing :
<apex:page standardController="dealer__c" extensions="test_customRL">
<apex:relatedList list="OpenActivities" title="custom related list" subject="{!custrl}" >
</apex:relatedList>
</apex:page>
and My Extension class code:
public class test_customRL {
public dealer__c de{get;set;}
public sub_dealer__c sd;
public List<task> rl = new List<task>();
public dealer__c getde(){
if(de == null) de = new dealer__c();
return de;
}
public void setde(){
this.de = de;
}
public test_customRL(ApexPages.StandardController controller) {
de = (dealer__c) controller.getrecord();
de = [select id,name from dealer__c where id = :de.id];
}
public List<task> getcustrl() {
sd = [select id,name from sub_dealer__c where dealer__c = :de.id];
rl = [select id,whatid,subject,type from task where whatid = :sd.id];
return rl;}
public void setcustrl(){
this.rl= rl;
}
}
I am getting the error :
The ID shown is the ID of task associated to sub_dealer__c object. One thing, I need to understand is how to pass the customized list of records to related list to be shown on VF page.
Any ideas plz!!
Thanks
dcoder