Skip to main content

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


I think you need to add a / in front of “soap/ajax/29.0/apex.js” — that should fix this error.


Reply