+ Start a Discussion
Mariappan PerumalMariappan Perumal 

Visualforce Override for Standard buttons and link

Hi all,

I had a requirement to sort out the campaigns held at different states. 

 

I created 3 view which will sort out the campaign as per the 3 states.

 

But suddenly the requirement is changed to 50 states , so we can't create 50 views for that even if we can , it looks awkward.

 

So I tried to create visualforce page with controller that get State name as input and based on that  visualforce page will dynamically  fetch the records campaign at that particular state.

 

I tried to override this visualforce page with standard buttons and links , (LIST ) but i didn't show me the visualforce page there.

 

But the fact is that I can override the same visualforce page with VIEW standard button and I also tried to override them with new button. Both of them respond good . 

 

I dont' know why i am unable to do that with LIST Button.

 

My question is "Is it possible with LIST standard button (i mean override that button)

 

If not , Is there any other way to do that.

 

Thanks in advance.

Best Answer chosen by Admin (Salesforce Developers) 
Vinit_KumarVinit_Kumar

To appear in the List Button,you will have to use recordsetVar attribute on VF page,something like below :-

 

<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" extensions="tenPageSizeExt" />

 

I think you are missing this attribute,that is why it is not showing uo there.

 

 

All Answers

Vinit_KumarVinit_Kumar

To appear in the List Button,you will have to use recordsetVar attribute on VF page,something like below :-

 

<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" extensions="tenPageSizeExt" />

 

I think you are missing this attribute,that is why it is not showing uo there.

 

 

This was selected as the best answer
Mariappan PerumalMariappan Perumal

Hi Vinit,

 

Thanks you so much for the reply.

 

Its working fine now.

 

Initially i was litte confused with List and View Standard Buttons. Its clear now.

 

I have two more question .

when we override standard View button with vf page means it will show off the vf page when we try to view any particular record with that vf page.  That looks pretty good.

 

But in case of standard List button , It works when i try to click on any of the options in the list ( i mean the picklist values).

Fact is that . It redirects me to vf page when i click on any one of those options in the list .

 

Is it possible to load the vf page when i click on any particular one (some exact option in the list). 

 

One more question :

 

Is it possible to have component on the campaign layout(campaign tab). and have that vf page so that it looks better.

 

 

Vinit_KumarVinit_Kumar

for first one,

 

You need to use actionStatus tag in your VF page to execute the method of your controller with exact string.Please go through the below link for the same :-

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionStatus.htm

 

For second one,

 

You can create a VF section on your page Layout and add that VF page to it.Please go through the below link for the same :-

 

http://blogs.developerforce.com/systems-integrator/2008/11/adding-a-visualforce-page-to-a-page-layout.html

Mariappan PerumalMariappan Perumal

Hi vinit,

 

The question i asked was little different. I tried to override Standard Go (List Button). Campaign Tab

 

Default View : All Active Campaign 

                  My Active Campaign and              Go button 

                State by Arizona(Custom view)

 

 

I have written a visualforce page and override the Go button .

 

so when i choose All Active Campaign and click Go button . It redirects me to visualforce page instead of showing me All actice campaign in the org.

In the same way If i choose My Active Campaign and click Go button .It redirects me to visualforce page instead of showing me All actice campaign in the org.

It does the same way for all option in view . since the Go button is overriden with visualforce . It does care of what option we have choosen in view.

 

My requirement is When i click on the State by Arizona , it should redirect me to that visualforce page. But when i click on other option like  All Active Campaign , My Active Campaign or others . It should take me  accordingly.

 

Is there a way to do like that. Can you assist me on this.