Uncaught+TypeError:+Cannot+read+property+'execute'+of+undefined

  • 1
  • Problem
  • Updated 3 years ago
  • Not a Problem
When trying to call a apex class on button click on skuid by running javascript snippet getting 'Uncaught TypeError: Cannot read property 'execute' of undefined'


Uncaught TypeError: Cannot read property 'execute' of undefined(anonymous function)
 @ skuid__ui?page=VINDecoding:116
k.custom @ skuid__SkuidJS:32
f.runActionNode @ skuid__SkuidJS:32
m @ skuid__SkuidJS:32
f.runActionsNode @ skuid__SkuidJS:32
i @ runtime.js:4
o.event.dispatch @ skuid__JQuery:3
r.handle @ skuid__JQuery:3


This is code of my snippet

var params = arguments[0], $ = skuid.$;


var vinJSON = {
    vinnumber: "2G1FC3D33C9165616"
};
var result = sforce.apex.execute("GetVIN","getVINDETAILS",{ dispatchJSON: JSON.stringify(vinJSON) });
console.log('the result was: ' + result);


I have added ajax toolkit 

Photo of rajasekhar reddy

rajasekhar reddy

  • 282 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
I think you need to add a / in front of "soap/ajax/29.0/apex.js" --- that should fix this error.