+ Start a Discussion
MeerMeer 

Refresh Detail Page via VF Page

Hi..

 

I have a VF page which I have added in my custom control page layout.. In VF Page I have a button which save a particular record, I want to refresh the whole detail page after saving the record (i.e. onclicking the button). Can anybody help me with this how can I refresh the whole page? I searched it but didn't get the appropiate answer, however after trying most of the snippet I got my VF Page section refreshed but not the whole detail page.

 

Regards,

Meer 

All Answers

Navatar_DbSupNavatar_DbSup

 Hi,

 

Use the below code snippet as reference:

 

======================Class===============

public class testRefresh

{

 public boolean blnRefresh{get;set;}

 public pagereference Save()

 {

  //Your code Here

  blnRefresh=true;

  return null;

 }

}

 

=====================VF Page===============

<apex:page controller="testRefresh" >

<script>

if({!blnRefresh})

{

    window.parent.location.reload();

}

</script>

<apex:form >

    <apex:commandButton action="{!Save}" value="Save"/>

</apex:form>

</apex:page>

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.