I have a flow in place that is assigned to a custom List Button on the Opportunity object. It is meant to create an Opportunity when the custom button is pressed the related list on the Account. The flow requires some fields to be completed on the Account before the Opportunity can be created (i.e., Industry, Website). I also want the user to be re-directed to the Opportunity Products page upon creation of the Opportunity. 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 click on the custom button, I get the error:

Error: Unable to Access Page The value of the "id" parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.

Does anyone know I am getting this error?

VF Page:

<apex:page standardController="Account" tabStyle="Account" Extensions="OpptyFlowController" recordSetVar="opportunities">
    <apex:outputField value="{!Account.Id}"/>
    <flow:interview name="Create_Opportunity_w_Parent_Fixed" interview="{!OppFlow}" 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}"/>


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 (Id)OppFlow.getVariableValue('OpportunityId');

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

  • Is the opportunity being created and giving you a valid Opportunity Id? – CyberJus Mar 27 '15 at 22:23
  • No. It's not making it to the Opportunity creation. – John N. Mar 28 '15 at 3:05
  • Does it work without the finishLocation parameter? If not, it is probably something with the Flow itself. Flow errors are not always the most useful. Try checking the debug logs in the developer console too. – CyberJus Mar 28 '15 at 21:52
  • My guess here is that the finishlocation method (getOID) returns an emptystring upon accessing the page. No idea why it does that, but it can be resolved by checking whether oppFlow == null, just like the getOppID method. Hope this helps – westerforce Mar 30 '15 at 5:34
  • Did you find a solution? Did my remark help? – westerforce Apr 4 '15 at 16:33

Your Answer

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

Browse other questions tagged or ask your own question.