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
Zain ButtZain Butt 

Creating VF Page to filter quotes related to the Opportunity Account

I'm new to Visualforce and have been tasked with creating a visualforce page to filter quotes related to the Opportunity Account. How do I create a visualforce page to filter the quotes?
Best Answer chosen by Zain Butt
HARSHIL U PARIKHHARSHIL U PARIKH
Hello ZaIn,

Here is an Opportunity object's visualforce page which doesn't include 'Quote' related list.
All you have to do is to supply id in th URL as ?id=01010145adas100
Visualforce Code:
<apex:page standardController="Opportunity">
    <apex:pageBlock title="Opportunity Detail Page">
        <apex:detail relatedList="false"/>
        
        <apex:pageBlockSection collapsible="true" title="Products" columns="1">
            <apex:relatedList list="OpportunityLineItems"/>
        </apex:pageBlockSection>
        
        <apex:pageBlockSection collapsible="true" title="Open Activities" columns="1">
            <apex:relatedList list="OpenActivities"/>
        </apex:pageBlockSection>
        
        <apex:pageBlockSection collapsible="true" title="Activity History" columns="1">
            <apex:relatedList list="ActivityHistories"/>
        </apex:pageBlockSection>
                
        <apex:pageBlockSection collapsible="true" title="Notes & Attachments" columns="1">
            <apex:relatedList list="CombinedAttachments"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
Save this visualforce page and then you can override standard page with this page and quote related list won't show up since its not on the code.
In this code I have added only few related lists such as products, open activities, notes and attachments etc.. but you can add as many as you like.
Let me know if it's works for you.

 

All Answers

Zain ButtZain Butt
Sample Code would be great!
HARSHIL U PARIKHHARSHIL U PARIKH
Hello ZaIn,

Here is an Opportunity object's visualforce page which doesn't include 'Quote' related list.
All you have to do is to supply id in th URL as ?id=01010145adas100
Visualforce Code:
<apex:page standardController="Opportunity">
    <apex:pageBlock title="Opportunity Detail Page">
        <apex:detail relatedList="false"/>
        
        <apex:pageBlockSection collapsible="true" title="Products" columns="1">
            <apex:relatedList list="OpportunityLineItems"/>
        </apex:pageBlockSection>
        
        <apex:pageBlockSection collapsible="true" title="Open Activities" columns="1">
            <apex:relatedList list="OpenActivities"/>
        </apex:pageBlockSection>
        
        <apex:pageBlockSection collapsible="true" title="Activity History" columns="1">
            <apex:relatedList list="ActivityHistories"/>
        </apex:pageBlockSection>
                
        <apex:pageBlockSection collapsible="true" title="Notes & Attachments" columns="1">
            <apex:relatedList list="CombinedAttachments"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
Save this visualforce page and then you can override standard page with this page and quote related list won't show up since its not on the code.
In this code I have added only few related lists such as products, open activities, notes and attachments etc.. but you can add as many as you like.
Let me know if it's works for you.

 
This was selected as the best answer
Zain ButtZain Butt
Thanks a ton!