0

I have a VF page related to a custom object called Equipment__c (named 'obj' in the page) as shown in the snippet below:

<apex:page controller="Reserve_Equipment" tabStyle="Equipment__c" action="{!Init}">
  <apex:relatedList subject="{!obj}" list="Equipment_Reservations__r" title="Existing Equipment Reservations" />   
  <apex:form id="form">
  <apex:actionFunction action="{!DisableLookUp}" name="DisableLookUp" reRender="form"/>
    <apex:pageBlock >
    <apex:pageBlockSection title="Reserve Equipment" columns="1">
    <apex:outputField value="{!obj.Name}"/>
    <apex:outputField value="{!obj.Equipment_Tag__c}"/>
     </apex:pageBlockSection>
...

It works fine in that it shows the Equipment_Reservations_c related list for my Equipment_c object.

But now I want to limit the records shown in this instance of the related list. On this page I only want to show records related to this equipment where Equipment_Reservations__c.Active = true and Equipment_Reservations__c.Start_Date__c >= system.today().

Since the 'subject' of my related list is actually my Equipment__c object I am not sure how I would do this.

Any help you could provide would be appreciated.

  • I fear this is not possible .You will need your own query in controller to achieve this requirement as Treckker says – Mohith Shrivastava Nov 21 '12 at 17:27
2

You wouldn't be able to leverage the rendered attribute when using the apex:relatedList, you would have to render your own related list using apex:repeat or apex:dataTable, and you can then use the rendered attribute to only selectively render rows, based on the boolean condition.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.