function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
shiva 463shiva 463 

How to refresh the page on click of a custom button in Edit page.

Hi All,

Can anyone help me in building the JavaScript for refresh the page on click of Custom button in Edit page.
I have oppurtunity page in this I have craeted a new record and saved it and after the save, the page will goes to edit page.In the edit page I have Custom button to claculate the amount from 3rdparty application and I am getting the reference Id from 3rd party application on refresh of  browser or click of browser.But my requirement is not to refresh the page by myself it has to automatically refresh the page and get the Refrence ID from 3rd party application.

Intially I have achieved like this using Java script but the page is not refreshing or reloading,So can anyone help me on this issue.

Code:{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
var myJob = new sforce.SObject("Opportunity");
myJob.Id = "{!Opportunity.Id}";
myJob.check__c= "true";
var result = sforce.connection.update([myJob]);
setTimeout(window.location.reload(true),60000);
window.location.reload(true);
User-added image

Here is the EDIT page what iam trying to achieveUser-added image
Harish RamachandruniHarish Ramachandruni
Hi,


use     location.reload();
 


Regards,
Harish.R
shiva 463shiva 463
Hi Harish,

Not working..
Sukesh Kumar 33Sukesh Kumar 33
Try javascript: document.location.reload(true)
AMAN TIWARI 9AMAN TIWARI 9

Thanks!!
Sarvesh Kumar 33 this has worked :)