+ Start a Discussion
Bryan HuntBryan Hunt 

Create New View for SObject List on Tab

Hello,

 

We have a custom SObject called Project. 

 

We have Opportunities related to Projects via a Lookup field. 

 

Sales Reps that are working on a specific Project create Opportunities against that Project.  These Opportunities show in a Related List on the Project record.

 

I would like to create a View on the Projects tab called "Projects I Am Working On".  The criteria would be: Show a list of all Project records that have a related Opportunity that I am the Owner of.  Unfortunately there is no way to enter that type of criteria in a new standard View.

 

My thought is to write a new VF page and controller to perform this function.  That should be simple enough.

 

But, can I have that appear in my drop-down list of Project Views?  Right next to the "All Projects" option?  Or would I have to create a custom button?

 

Is this the correct way to create this functionality, or is there a better method using something built-in that I am not aware of?

 

Thanks for any and all assistance.

 

Bryan Hunt

SRKSRK

you want this view just for single user or for 4-5 users then i have a kind a soluction for u r peoblem
but it won't work for large number of users

dmchengdmcheng

The VF page cannot appear in the list view.  However, you could create a custom tab for it, so you would have the standard Projects tab and then the My Projects VF tab.

Bryan HuntBryan Hunt

All,

 

What I really wanted to do here is use the standard List View while overriding its controller to allow me to filter the record set that I wanted.

 

I contacted SFDC tech support, and they confirmed that this is not possible.

 

So I am going to write my own List View VF page and controller.

 

Thanks.

 

Bryan Hunt

SRKSRK

It's Possible
Hear is a Example

Class

publicclass tenPageSizeExt {

    public tenPageSizeExt(ApexPages.StandardSetController controller) 
{ Now controller is a set of all selected records u can do what ever u want } }

Page

 

  1. <apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" extensions="tenPageSizeExt">
        <apex:form >
            <apex:pageBlock title="Edit Stage and Close Date" mode="edit">
                <apex:pageMessages />
                <apex:pageBlockButtons location="top">
                    <apex:commandButton value="Save" action="{!save}"/>
                    <apex:commandButton value="Cancel" action="{!cancel}"/>
                </apex:pageBlockButtons>
                <apex:pageBlockTable value="{!selected}" var="opp">
                    <apex:column value="{!opp.name}"/>
                    <apex:column headerValue="Stage">
                        <apex:inputField value="{!opp.stageName}"/>
                    </apex:column>
                    <apex:column headerValue="Close Date">
                        <apex:inputField value="{!opp.closeDate}"/>
                    </apex:column>
                </apex:pageBlockTable>      
            </apex:pageBlock>
        </apex:form>
        </apex:page>

Create a custom button on opportunities.

  1. Click Your Name | Setup | Customize | Opportunities | Buttons and Links.
  2. Click New in the Custom Buttons and Links section.
  3. Set the Label to Edit Stage & Date.
  4. Set the Display Type to List Button.
  5. Set the Content Source to Visualforce Page.
  6. From the Content drop-down list, select oppEditStageAndCloseDate.(MY page Name)
  7. Click Save.
  8. A warning will display notifying you that the button will not be displayed until you have updated page layouts. Click OK.

Add the custom button list view

SetUp> Customize > Opportunities >Search Layouts >Opportunities List View
click on edit
In Custom Button section add u r button
then it is able able when u go to standard list view & click GO
with a check box on every record all the records that u select & click on button 

all the selected recordds are able able in  StandardSetController (it's a set of all selected records)

SRKSRK

The custom button will only show on the list view after you actually execute a view (press Go). Until then, only the default "New" button is visible.

 

 

 

Bryan HuntBryan Hunt

SRK,

 

A pageblocktable is what I am going to end up doing, but it is not what I wanted to do.

 

I wanted to utilize the built-in listview feature (with sortable columns, user-defined filters, etc) but I wanted to control which records from the sobject table were included in the view (basically overriding the listview's default controller).  SFDC tech support says that it can't be done, so going to go to plan B which was the pageblocktable route.

 

Thanks.

 

Bryan Hunt

SRKSRK

Create  view
& create a web tab so when user click on it it directly redirct to your view