javascript - AJAX toolkit -- problem with webservice execute -
javascript - AJAX toolkit -- problem with webservice execute -
i'm having hard time understanding going on here. trying code onclick javascript button on force.com list view custom object. here's js.
{!requirescript("/soap/ajax/15.0/apex.js")} {!requirescript("/soap/ajax/15.0/connection.js")} var myurl = sforce.apex.execute("mywebservices", "myurl", {});
and here's webservice i'm attempting call.
global class mywebservices { webservice static string myurl(){ homecoming 'www.foo.com'; } }
when click button, little alert pop-up saying:
"a problem onclick javascript button or link encountered: cannot phone call method 'execute' of undefined" when iterate members of "sforce", there no "apex".
i using literally exact same syntax in button in same org, difference beingness methods calling. button works. in fact, if re-create code problem script , set @ head of working script on other button works. missing here?
here farther detail on 2 buttons element of issue: 1 button (that works) list view button on account, other (broken) 1 on custom object list button foo__c.
i utilize code both:
{!requirescript("/soap/ajax/10.0/apex.js")} {!requirescript("/soap/ajax/10.0/connection.js")} alert( sforce.apex.execute("hammockwebservices", "crosscoverageurl", {}));
on business relationship works perfectly, on foo__c not. i've tried switching order of !require... statements no observable effect.
besides label , name of buttons seem defined identically: list button display checkboxes execute javascript onclickjavascript
are there object-level permissions, profiles, or sharing rules impact javascript packages can accessed? (note, case, i'm trying sysadmin, , getting nowhere...)
does organization utilize namespaces? if so, syntax of calling function changes from:
var myurl = sforce.apex.execute("mywebservices", "myurl", {});
to:
var myurl = sforce.apex.execute("mynamespace.mywebservices", "myurl", {});
javascript ajax salesforce
Comments
Post a Comment