You need to sign in to do that
Don't have an account?

Flow variables not passing back to VF Controller Extension
For some reason my variables from my Flow are passing back as null to my VF Controller extension. Trying to set the finish page using these. Was able to understand how in another post (Rajaram).
Controller extension is below. The vafacilityid is an Input/Output variable in Flow FacilityLookup and should return the Account ID newly created. In the flow I added a screen that validates that the variable does have a value at the end of the flow so something is wrong with the controller?
Controller Extension
public class flowFinishContExt_Acct {
private final Account acct;
public flowFinishContExt_Acct(ApexPages.StandardController stdController) {
this.acct = (Account)stdController.getRecord();
}
public Flow.Interview.FacilityLookup atFlow {get; set;}
public String getaccountID() {
if (atFlow==null) return '';
else return atFlow.vafacilityid;
}
public PageReference getFinishPage(){
PageReference p = new PageReference(''/apex/FacilityMainTabbed' + getaccountId());
p.setRedirect(true);
return p;
}
}
This seems like a little bug to me. I'll also post to the Flow people.
There was nothing wrong with the code below. When I looked at log files, the variable value was null from the Flow. But if I add a screen to check the value of the variable inside the Flow, it was populating. SO, I tried keeping that screen in place when running the Flow and...voila it worked!
So what this means is that if the Flow essentially ends on a Record Create statement (I also had a decision after this and that was still a problem), then the variable doesn't get passed back and is null. Don't ask me why, but I've now added a confirmation screen for the user as the last step and all works fine.
All Answers
This seems like a little bug to me. I'll also post to the Flow people.
There was nothing wrong with the code below. When I looked at log files, the variable value was null from the Flow. But if I add a screen to check the value of the variable inside the Flow, it was populating. SO, I tried keeping that screen in place when running the Flow and...voila it worked!
So what this means is that if the Flow essentially ends on a Record Create statement (I also had a decision after this and that was still a problem), then the variable doesn't get passed back and is null. Don't ask me why, but I've now added a confirmation screen for the user as the last step and all works fine.
I've run into the same issue. I have a multi-screen flow and the flow variables that have default values that are pulled from the last screen of the flow do not get set.
If I kludge it and add a "dummy" screen after my real last streen, those flow variables are then set correctly.
Matt Beitler
Chatham Financial