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
Ram ChaturvediRam Chaturvedi 

I am getting a error at the calling time of apex class by using costom java script button .?


var r = confirm(" Are you sure to call the apex class ?");
if(r == true)

alert("Sent it for class");

global class javasclass {

    webservice static void check(string x){
        system.debug('this is x '+x);

It gives a error :

  User-added image
Hi Ram,

You should use variable name 'x' not str. Try changing sforce.apex.execute("javasclass","check",{str:'Amit'}); to sforce.apex.execute("javasclass","check",{x:'Amit'}); this should work.

Ram ChaturvediRam Chaturvedi
Thanks Bhushan