Skip to main content
I have a flow in my sandbox that has an input variable named oppId that is used to pass the opportunity ID into the flow. I was writing my flow and testing it as I completed each part. Suddenly the flow started throwing an error because the oppId was null in a Create Records element that was supposed to add products to the opportunity  I added a screen to display the value of oppId at the beginning of the flow, and it shows that the oppId is null. I'm puzzled, because I didn't make any changes outside of the flow - why did oppId suddenly no longer have a value in it?

 

This is how the flow is called:

 

Custom button

 

Opportunity ID is suddenly no longer getting passed into my flow in Sandbox

 

Visualforce page

<apex:page controller="SplitCustomBundlesController" action="{!goopp}" showHeader="false" sidebar="false" lightningStylesheets="true">

<flow:interview name="Split_Custom_Bundles" interview="{!my_interview}" finishlocation="{!NewLoc}">

<apex:param name="OppId" value="{!oppId}" />

</flow:interview>

</apex:page>

Controller

public class SplitCustomBundlesController {

public Flow.Interview.Split_Custom_Bundles my_interview {get; set;}

public string oppId {get;set;}

public PageReference getNewLoc() {

PageReference newloc;

newloc = new PageReference('/' + oppId);

return newloc;

}

public void goopp() {

oppId = ApexPages.currentPage().getParameters().get('oppID');

}

}

Flow

 

Flow screenshot

 

Debug Screen

 

Debug screen

 

Debug Text

 

Debug text
3 respostas
  1. 20 de mai. de 2021, 11:37

    Problem solved. I found that there was a case disparity for the oppId parameter between the VF page and the flow. In the VF page I was using 

    <apex:param name="OppId" value="{!oppId}" />

    But in the flow the name of the variable is "oppId". I must have modified the VF page inadvertently to cause the problem.

0/9000