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 

A problem with the OnClick JavaScript for this button or link was encountered: document.reload is not a function

Hi All,

Iam trying to referesh the page on click of button in detail page. I tried with the following script but get an popup error and iam getting the result finally but popup should be removed.So can any one help me on this issue.

Script:
{!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(document.location.reload(true),60000); 
document.reload(true);User-added image
sandeep madhavsandeep madhav
Hi,
Use location.reload(forceget);
forceget :
false - Default. Reloads the current page from the cache.
true - Reloads the current page from the server

Hope this helps
shiva 463shiva 463
Hi Sandeep,

I tried with ur suggestion its not working.