• AMAN TIWARI 9
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
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