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
John NeilanJohn Neilan 

Add VF Page to Custom List Button

Hello,

I've created a custom VF Page and a custom controller.  I want to add a custom List button to the Opportunity object that will invoke this VF page when pressed.  However, when I try to create the button, my VF page does not appear as an option.  Does anyone know how I can get it to appear?  Thanks.

VF Page:
<apex:page standardController="Opportunity" tabStyle="Opportunity">
    <flow:interview name="Create_Opportunity_w_Parent_Fixed" finishLocation="/p/opp/SelectSearch?addTo={!opportunity.Id}&retURL=%2F{!opportunity.Id}"/>
</apex:page>

VF Controller:
public class OpptyFlowController {

  public Flow.Interview.Create_Opportunity_w_Parent_Fixed OppFlow { get; set; }

    public String getOppID() {
      if (OppFlow==null) return '';
      else return OppFlow.OpptyID;
    }

  public PageReference getOID(){
    PageReference p = new PageReference('/p/opp/SelectSearch?addTo=' + getOppID() + '&retURL=%2F' + getOppID();
    p.setRedirect(true);
  return p;
  }

}


 
Best Answer chosen by John Neilan
PandeiswariPandeiswari
Please add attribute recordSetVar="opportunities" in <apex:page> 

All Answers

PandeiswariPandeiswari
Please add attribute recordSetVar="opportunities" in <apex:page> 
This was selected as the best answer
Dushyant SonwarDushyant Sonwar
Hi john,
See this
https://success.salesforce.com/answers?id=90630000000grS1AAI
This will help you
John NeilanJohn Neilan
Thanks Pandeiswari, that's what I was missing!