• TensorTenor
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

I have what I thought would work as a flow embedded in a visualforce page with a custom controller, but I am running into a bit of an issue at runtime. Here is the code for the VF page:

<apex:page controller="TestimonialLookupbyAreaFlowController">
  <flow:interview name="Testimonial_Lookup_by_Area" interview="{!TLBAFlow}" finishLocation="{!ReportParam}" />
</apex:page>

 And here is the code for the controller:

public class TestimonialLookupbyAreaFlowController{
    public Flow.Interview.Testimonial_Lookup_by_Area TLBAFlow{get; set;}
    
    public String getZip(){
    	if(TLBAFlow==null) return '';
        else return TLBAFlow.Zip_to_Pass;
    }
    
    public pageReference getReportParam(){
    	PageReference p = new PageReference('/00OQ0000000GWwx?pv0=' + getZip());
        return p;
    }
}

 The finishLocation is a report that I am passing a variable to from the flow. I can get to the report with no problem, but whatever is in the variable doesn't matter as the parameter is always null. I removed the if statement from the getZip() method and I believe I have figured out what is going on but not why. After removing the if statement I got an error about attempting to de-reference a null object when I attempted to open the VF page. So I am assuming that as the code stands currently, every time getZip() is called, the comparison 'TBLAFlow == null' is returning true, thus the parameter is always a null string. Does anyone have any idea why the flow object is null here?

I have what I thought would work as a flow embedded in a visualforce page with a custom controller, but I am running into a bit of an issue at runtime. Here is the code for the VF page:

<apex:page controller="TestimonialLookupbyAreaFlowController">
  <flow:interview name="Testimonial_Lookup_by_Area" interview="{!TLBAFlow}" finishLocation="{!ReportParam}" />
</apex:page>

 And here is the code for the controller:

public class TestimonialLookupbyAreaFlowController{
    public Flow.Interview.Testimonial_Lookup_by_Area TLBAFlow{get; set;}
    
    public String getZip(){
    	if(TLBAFlow==null) return '';
        else return TLBAFlow.Zip_to_Pass;
    }
    
    public pageReference getReportParam(){
    	PageReference p = new PageReference('/00OQ0000000GWwx?pv0=' + getZip());
        return p;
    }
}

 The finishLocation is a report that I am passing a variable to from the flow. I can get to the report with no problem, but whatever is in the variable doesn't matter as the parameter is always null. I removed the if statement from the getZip() method and I believe I have figured out what is going on but not why. After removing the if statement I got an error about attempting to de-reference a null object when I attempted to open the VF page. So I am assuming that as the code stands currently, every time getZip() is called, the comparison 'TBLAFlow == null' is returning true, thus the parameter is always a null string. Does anyone have any idea why the flow object is null here?