I have a visualforce page that runs a flow and use a custom controller extension to set the finish location based on the user profile. (Basically it re-directs back to the original opp record, which has a slightly different URL for partner community users.) The visualforce page is being called by a custom button on the opportunity record.
Everything works as expected in the (partial copy) sandbox, but in production, the parameter does not get passed to the controller. Is there an error with the code or anything else that would prevent this from working in production?
Visualforce page:
<apex:page standardController="Opportunity" extensions="My_Controller" tabStyle="Opportunity" >
<flow:interview name="Resend_Registration_Email" finishLocation="{!OppPage}">
<apex:param name="var_Opp_Id" value="{!Opportunity.Id}" assignTo="{!oppId}"/>
</flow:interview>
</apex:page>
Controller:
public class My_Controller {
public My_Controller(ApexPages.StandardController controller) {
}
public String retURL;
public String oppId {get;set;}
public String userProfileName {
get {
return [
select Profile.Name
from User
where Id = :Userinfo.getUserId()
].Profile.Name;
}
}
public PageReference getOppPage() {
if(oppId == null){
oppId = '006';
}
if(userProfileName != null && userProfileName.contains('Partner')){
retURL = '/partner/' + OppId;
} else {
retURL = '/' + OppId;
}
System.debug('Return URL: ' + retURL);
return new PageReference(retURL);
}
}