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 

List Button to VF Page

Hello,

I've created a custom List button on the Opportunity object that sits on the related list of the Account object.  Users go to an Account, and when they want to create a new Opportunity they click this button, which overrides the standard New button on the Opportunity related list.  When clicking the button, the user is redirected to a VF page (below), which then invokes a custom flow from a custom VF controller.  The flow works properly on its own, however, when I try to save the VF page, I get the error:

Error: No variable named "AccountWebsite" in flow

Can anyone help me figure out why I am getting this error and how to fix it?

VF Page:
<apex:page standardController="Account" tabStyle="Account" Extensions="OpptyFlowController" recordSetVar="opportunities">
    <flow:interview name="Create_Opportunity_w_Parent_Fixed" finishLocation="{!OID}">
      <apex:param name="AccountId" value="{!Account.Id}"/>
      <apex:param name="AccountWebsite" value="{!Account.Website}"/>
      <apex:param name="AccountIndustry" value="{!Account.Industry}"/>
      <apex:param name="AccountCountry" value="{!Account.BillingCountry}"/>
      <apex:param name="AccountSubIndustry" value="{!Account.Sub_Industry__c}"/>
    </flow:interview>

</apex:page>
VF Controller:
public class OpptyFlowController {

  public ApexPages.StandardSetController stdControl{get; set;}
  public OpptyFlowController(ApexPages.StandardSetController controller) {
      stdControl = controller;
  }

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

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

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

}


 
claperclaper
By the error you are getting. Seems that the problem is at the Flow. Please re-check the spelling for the "AccountWebsite" variable definition in your flow; ensure the :
<apex:param name="AccountWebsite" value="{!Account.Website}"/>
And the api name on you flow for the variable matches correctly to "AccountWebsite"
John NeilanJohn Neilan
Thanks, but the name is correct in the flow and the VF page.  For some reason it's not passing through to my VF flow call.