[SalesForce] Visualforce Error dealing with visual flow and custom button

I created a visual flow that creates an opportunity, contact, and account department from one form. I made a custom button called "Create Service Contract" and put it on the account page layout that references a visualforce page called "OpptyFlowController." I had this button working so it was directing to the correct finish location. However, about 2 days ago I input a custom home component on the side bar and hid it from the users that relates to a different visualforce page. I don't know if this is what is giving me the error or why I would be receiving it now since it had worked before. Any help would be great! (Update: Found out that my flow isn't working due to an internal server error–any way to fix this?)

Class:

public class OpptyFlowController {
  public OpptyFlowController(ApexPages.StandardController controller) {

  }

  public Flow.Interview.Service_Contract_Flow myFlow { get; set; }

  public String getmyID() {
    if (myFlow==null) return '';
    else return myFlow.varOppId;
  }

  public PageReference getOID(){
    PageReference p = new PageReference('/apex/addserviceproducts?id=' + getmyID());
    p.setRedirect(true);
    return p;
  }
}

Visualforce Page:

<apex: page standardcontroller="Account" extensions="OpptyFlowController">
  <br/>
  <flow:interview name="Service_Contract_Flow" interview"{!myflow}" finishlocation="{!OID">
    <apex:param name="AccountID2" value="{!Account.Id}" />
  </flow:interview>
</apex:page>

Error I receive when I click on the custom button on the account page:

Visualforce Error
java.lang.reflect.InvocationTargetException
Error is in expression '{!componentBody}' in component in component interview.apexc

Best Answer

Salesforce Support finally responded with this fix:

To address the error, Tier 3 has updated the Screen Choice Field from 'Contact' to 'Contact2' of 'Service Contract Flow'.

Please apply the same workaround to the other Flows that throw the error. Also, do not use the same dev name of your Choice Lookup anywhere else in your flow.

Here is the link to the known issue:

https://success.salesforce.com/issues_view?id=a1p30000000T4RaAAK

As noted on the page, it has a scheduled patch in the Summer '14 Release.

Related Topic