+ Start a Discussion
SidharthSidharth 

Apex flow finishLocation change parent url

I have a flow embedded inside a VF page, which is embedded inside account detail page.

 

On finishLocation i can set the vf page url, but not the parent account detail page url.

 

I want to refresh the account detail page, so that i can see the flow reults, without manually refreshing it.

 

Can we use something like target attribut in pagereference, and set it to _parent to refresh the parent page ?? or any idea ??

 

Flow:

<flow:interview name="CSR_Withdrawal" finishLocation="{!FlowFinishLocation}" id="withrawlCSR" rendered="{!ShowWithrawlCSR}">
           <apex:param name="ID" value="{!account.id}"/>
</flow:interview>

 

Controller method:

public PageReference getFlowFinishLocation() {
     String url = '/apex/ClientAlerts?id=' + acct.id;
     Pagereference p = new Pagereference(url);
     return p;
}

Best Answer chosen by Admin (Salesforce Developers) 
Maros SitkoMaros Sitko

You can try use javascript  window.top.location='/{!account.id}' , which refresh parent window.( you can create button for refresh)

 

OR

 

Insert this javascript into new empty VF page, and use this empty page in finishLocation with parameter Id

 

so page will be

<page>
 <script>
  window.top.location='/{!$CurrentPage.parameters.id}';
 </script>
</page>

and controller method

public PageReference getFlowFinishLocation() {
  return '/apex/redirectPage?id='+ acct.id;
}

 

I do not tried it, but it should works

 

 

All Answers

Maros SitkoMaros Sitko

You can try use javascript  window.top.location='/{!account.id}' , which refresh parent window.( you can create button for refresh)

 

OR

 

Insert this javascript into new empty VF page, and use this empty page in finishLocation with parameter Id

 

so page will be

<page>
 <script>
  window.top.location='/{!$CurrentPage.parameters.id}';
 </script>
</page>

and controller method

public PageReference getFlowFinishLocation() {
  return '/apex/redirectPage?id='+ acct.id;
}

 

I do not tried it, but it should works

 

 

This was selected as the best answer
SidharthSidharth

Awesome, second solution worked, though it required a new vf page.

Thanks !!