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
Marty Y. ChangMarty Y. Chang 

SOAP error from calling sforce.apex.execute method in JavaScript custom button

Does anyone have any ideas on why I’m getting this error when trying to execute Apex via Javascript in a custom button?


{faultcode:'soapenv:Client', faultstring:'The content of elements must consist of well-formed character data or markup.', }


I’m trying to following the example in the documentation below:


“Apex in AJAX”


My Apex class method is essentially as follows:


global class MyInterface {
  webService static void performInterfaceAction(List<Id> accountIds) { }


My JS in the button is as follows:



var result = sforce.apex.execute("MyInterface", "performInterfaceAction", {!GETRECORDIDS( $ObjectType.Account )});





Below code returns comma sepereted list of Ids , Not List<Id>, try with changing argument of service as string then work on it


{!GETRECORDIDS( $ObjectType.Account )}