I have an inline visualforce page on Case layout. When the case page is loaded, this loads the vf page and there is an action call on the inline vf.

<apex:page name="xyz" standardController="Case" extensions="xyzcallout" action="{!WebServiceMethod}">

The WebServiceMethod method is a callout to external application. Based on the values coming in from the callout Case.Status is updated.

if(field_name == 'Defined'){
         cas.Status = 'Approved';
         update cas;

However, the Case layout doesn't show the update until the second refresh. On page load case still shows old status while inline VF page shows new status. On refresh, Case Status shows new value.

 function refreshPage(){
  return false;
 window.onload = setTimeout(function(){refreshPage()},2000); 

I tried using the above javascript to reload page on completion of action but it doesn't seem to work for me.

My Question: Is there a way to update the Case field after inline VF load action without a button click or any user action.

  • You'll have to refresh the parent page from the inline VF using Javascript when the action completes.
    – Adrian Larson
    Commented Feb 15, 2017 at 19:56
  • Thanks Adrian. I am using the above javascript but it doesn't work for me. Could you let me know what I am missing?
    – Vick
    Commented Feb 15, 2017 at 20:01
  • Does it actually execute? If not check your Javascript for errors. You may need to set a timeout so it executes after the callout completes.
    – Adrian Larson
    Commented Feb 15, 2017 at 20:02
  • Yes, It executes without the return false; however it goes into an infinite loop and keeps on refreshing. With the return false; it doesn't execute. Updated the original question with js code.
    – Vick
    Commented Feb 15, 2017 at 21:10
  • You'll need to make sure you only fire this script if the update is necessary. Should suffice to add a Boolean property that tells you if field_name == Defined' && cas.Status != 'Approved'.
    – Adrian Larson
    Commented Feb 15, 2017 at 21:12

1 Answer 1


Thanks for your help Adrian. I got it to finally work using sessionStorage.

 if ( !sessionStorage["reloaded"] ){
            sessionStorage["reloaded"] = true
            window.top.location='/{!Case.id}'; return false;
            }, 2000);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .