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
Gulshan Ara 7Gulshan Ara 7 

sforce.apex.execute() is async or sync in SFDC Classic, JavaScript button click

I wanted to understand that if i am calling an apex webservice method on a javascript button click via execute method like below as a sample

var result= sforce.apex.execute("methodname","param",{Id:Id});
document.location.reload();

so is the sforce.apex.execute method work as async or sync? will the document.location.reload() have to wait untill i get a response from my apex method or it will refresh my page.

My problem is i really want to execute it async and just make a call to the apex method where i am handling all the stuff via platform events and on front end just want to reload the page. but currently it seems like it blocks the page reload untill all functionality at the backend complete and than proceed. 

Any help in this regard will be appreciated.
Raghu NaniRaghu Nani
HI Bro,

Any luck for above your problem. I also need solution for similar problem.