You need to sign in to do that
Don't have an account?
ECL47
Close VF/Flow and Refresh Parent
I've been reading the other posts, but due to my lack of coding experience (button admin just learning code) I'm having difficulting translating solutions for standard VF pages to my Flow VF page where I have no code for the buttons.
I have a flow which is launched in a new window through a custom link on a custom object. I want the window to close and refresh the custom object page when the flow is completed. I have two VF Pages - The first with the flow, and the second which I am using as a finish location which holds my Javascript currently. I have been able to get the new window to close using the code below, but I have been unsuccessful in getting any code to refresh the custom object/parent window. Any help/recommendations would be appreciated!
Custom Link
/apex/New_PP_with_Listing_Decision_Tree?pba_property_id={!pba__Listing__c.pba__PropertyId__c}
Flow VF Page - New_PP_with_Listing_Decision_Tree
<apex:page showHeader="False" sidebar="False">
<flow:interview name="New_PP_with_Listing_Decision_Tree" finishLocation="{!$Page.Close}" >
</flow:interview>
</apex:page>
Javascript VF Page - Close
<apex:page >
<script type="text/javascript">
window.close();
</script>
</apex:page>
I have a flow which is launched in a new window through a custom link on a custom object. I want the window to close and refresh the custom object page when the flow is completed. I have two VF Pages - The first with the flow, and the second which I am using as a finish location which holds my Javascript currently. I have been able to get the new window to close using the code below, but I have been unsuccessful in getting any code to refresh the custom object/parent window. Any help/recommendations would be appreciated!
Custom Link
/apex/New_PP_with_Listing_Decision_Tree?pba_property_id={!pba__Listing__c.pba__PropertyId__c}
Flow VF Page - New_PP_with_Listing_Decision_Tree
<apex:page showHeader="False" sidebar="False">
<flow:interview name="New_PP_with_Listing_Decision_Tree" finishLocation="{!$Page.Close}" >
</flow:interview>
</apex:page>
Javascript VF Page - Close
<apex:page >
<script type="text/javascript">
window.close();
</script>
</apex:page>
Javascript VF Page - Close
<apex:page >
<script type="text/javascript">
window.parent.location.reload(); OR window.parent.reload();
window.close();
</script>
</apex:page>
With the first suggestion - the window would close but the parent did not refresh
with the second suggestion - the parent did not refresh and the window did not close. Instead, it went to /apex/Close (which is blank)
Javascript VF Page - Close
<apex:page >
<script type="text/javascript">
window.opener.reload();
window.close(this);
</script>
</apex:page>
Regards,
- Harsha
Flow VF Page - New_PP_with_Listing_Decision_Tree
<apex:page showHeader="False" sidebar="False">
<flow:interview name="New_PP_with_Listing_Decision_Tree" finishLocation="/apex/Close?pba_property_id={!$CurrentPage.parameters.pba_property_id}" >
</flow:interview>
</apex:page>
Javascript VF Page - Close
<apex:page >
<script type="text/javascript">
window.opener.location.href="/{!$CurrentPage.parameters.pba_property_id}";
self.close();
</script>
</apex:page>
Visualforce Close Page:
Name: FlowDesigner_Close_Page The FinishURL page parameter is used in the next visualforce page. This will reload the starting window with the URL passed in this parameter (could also be another URL).
Visualforce Start Page:
Name: FlowDesigner_Start_QuoteProcess
- 'Quote_Process_v4' is the name of my visual flow.
- Finishlocation points to the Visualforce Close Page
- 'Opportunity_input_ID' is an input variable in my flow, I will fill this with the button, see below
Button to Start the flow:Name: New_Quote This button lives on the opportunity and the ID of the current record is passed into: 'Opportunity_input_ID'
Not yet with Lightning Runtime, because you have no Lighnting Runtime with VisualForce as far as I know. I do know that you can embed a Flow into a lightning page (withouf VF) and when this finishes it refreshes the page. Might this be a solution?