+ Start a Discussion
Animesh DattaAnimesh Datta 

Refresh Standard Page when Visualforce pop-up closed

Hi All,

I have a button on Case Layout. On click of this button Visualforce page opens up in a new window. there is one button one button "OK" on the VF page. on click of this Command button VF page closes and few fields are updating back to Case. I can see fields are updating when I refresh the Case manually. I want refresh case automatically while clicking on the "OK" button and page closes.

Note: I am not using Service Console.

Kindly Help!!

Regards,
Animesh
Vishnu VaishnavVishnu Vaishnav
Hi Animesh,

I think this is not seems posible, but if u override standard page then it will be posible.

 
Animesh DattaAnimesh Datta
Hi Vishnu,

Thanks for your reply!!!!!

I am fine with overriding visualforce page with Standard case page on completion. Kindly guide me on this.

Regards,
Animesh
karondefranckarondefranc
Check this out:

http://www.salesforce.com/docs/developer/pages/Content/pages_quick_start_tabs.htm
Animesh DattaAnimesh Datta
Hi,
I went through the link, but this is not the requirement. this will override my Standarrd case layout with vf page. I am fine if on completion of all action in vf page, vf page over rides with the standard case page layout and with all fields updated properly. Please let me know this is feasible.
 
karondefranckarondefranc
Animesh,

Am not sure if your requirement would be feasible - opening a new vf from a button on a page, and upon completion of the new vf, the original page refreshes.

One alternate for thought - override the standard Case page with a vf page using <apex:detail> tag. In addition, embed a modal dialog vf component only rendered for the field update. After the update is finished, disable the rendering of the vf component and refresh the entire vf page. 
Santanu HalderSantanu Halder
Hi Animesh, I dont know if you already have got the soluion to this. But I was able to achieve this.

I used one Detail Page button to call OnClick Javascript which opens a Modaldialouge(child page) and reloads the current page. I make the necessary changes there and click save.. now in the save action I save the record and in oncomplete event I close the window. This solves my problem. Here is the code

My OnClick Javascript of the button


function popupB(incid) {
var returnval = window.showModalDialog('/apex/SaveOwner?id='+incid,"name", "center:yes;dialogWidth:600px;dialogHeight:200px;dialogLeft:400px;dialogTop:300px;");
   return false;
}

popupB('{!Incident__c.Id}'); //It opens the new modaldialouge
location.reload(true); //It waits for the modal to get closed, then reloads current page.

And in the child page, add a button like this

<apex:commandButton action="{!changeOwner}" value="Save" oncomplete="Javascript:window.close();" />

Working like magic now!