2

I have a flow in place for Opportunity creation from the Account. The flow requires some fields to be completed on the Account before the Opportunity can be created. I also want the user to be re-directed to the Opportunity Products page upon creation. In order to do this, I created a custom VF page and controller and utilized the Flow component in the VF page. However, when I try to save the VF page, I get the error:

Error: No variable named "AccountWebsite" in flow.

In the flow, the variable name listed in the Decision for requiring a website is called AccountWebsite, which is what I have in my VF page. The variable is a text variable and private. Does anyone know I am getting this error?

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;
  }

}

Flow: Flow

Flow Error: Flow Error

  • Not exactly sure, but are the other variables being mentioned in the flow are private as well? Is this issue gone if you comment out the statement for AccountWebsite – CloudConnect Mar 21 '15 at 19:49
  • probably unrelated, but shouldn't the line "else return OppFlow.OpportunityId" be "else return (Id)OppFlow.getVariableValue('OpportunityId')"? – westerforce Mar 25 '15 at 7:33
2

Make sure the variables in your flow are input or input/output. Also, make sure you have the same spelling, capitalization and format. Account_Website is not the same as accountwebsite.

  • Thanks. I changed all my variables to input/output and the variable name is the same as in my flow. When I changed the variables to input/output, my VF page saved, but I still get a validation error in the page to provide a website an industry. Any idea why? – John N. Mar 23 '15 at 20:56
  • Not without looking at it. Still not sure what you mean a "validation error on the page". What is the exact error message you get, and where and when exactly do you get it. Could you share a screenshot of the error message? – JimRae Mar 23 '15 at 21:05
  • So, my guess is that the account record lookup isn't getting those fields queried, or your decision element is evaluating against the wrong values. You could add some debug screens that just display the values you are testing to see if they are populated. – JimRae Mar 23 '15 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.