function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Heather_HansonHeather_Hanson 

Customize Visualforce Page Releated List

My PMs want to see which other opportunities have been signed when they receive an approved opportunity.  I created a VF page add an opportunity related list and it works, but I can't figure out how to ONLY show those where StageName = 'SIGNED'.  

Any help would be appreciated...
 
<apex:page standardController="Opportunity" showHeader="false" sidebar="false" readOnly="true">
<style type="text/css">
.actionColumn {display:none; visibility:hidden}
</style>

    <apex:relatedList list="Account.Opportunities">
    <apex:facet name="header"><center><b></b></center></apex:facet>
    </apex:relatedList>

</apex:page>

 
Sujeet PatelSujeet Patel
Hii
Heather 
You have create your own controller and call it on vf page and then it will show
I am sending you some basic example of code to do this
<apex:page controller="RelatedListController"> 
    <apex:pageBlock title="Opportunity">
        <apex:pageBlockTable value="{!opdata}" var="oppr"> 
            <apex:column value="{!oppr.name}"/>
        </apex:pageBlockTable>    
    </apex:pageBlock>

</apex:page>
 
public with sharing class RelatedListController{

    public List<Opportunity> opdata{get;set;}
    
    public RelatedListController(){
    
      String recordid= ApexPages.currentPage().getParameters().get('id');
      opdata=[select id,name from Opportunity where AccountID=:recordid and StageName='Prospecting'];
        System.debug('++++++++++'+opdata);
    }


}

I hope my this will help full for you
Heather_HansonHeather_Hanson
Thanks for the help!  But when I used the custom controller, it is no longer available for me to add to the opportunity page layout...am I doing something wrong?