I am newbie. I'm trying to pass in a List of recordids through the use of a custom button from a List View in classic. The parameters section of the sforce.apex.execute method is not right.
{!REQUIRESCRIPT("/soap/ajax/50.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/50.0/apex.js")}
var ids = {!GETRECORDIDS( $ObjectType.Request__c )};
sforce.apex.execute("UpdateWireStatus","getWireDetails",{ids}); <<<---??
window.location.reload();
Here is the Apex Class that will receive the List of Ids.
global class UpdateWireStatus {
@TestVisible
private static Boolean testException = false;
webService static void getWireDetails( List<Id'> requestIdList) {
System.debug('ID:' + requestIdList);
List<Request__c> requestRecordList = PershingHelper.getRequestRecords(requestIdList);
for (Request__c thisRequest : requestRecordList) {
Pershing.getWireDetails(thisRequest);
}
try {
if(testException) {
throw new RTSCallout.ApiException('Test Exception');
}
Database.update(requestRecordList, false);
}
catch(Exception e) {
System.debug('Error updating Request: ' + e.getMessage() + ':' + e.getStackTraceString());
}
}
}
{"ids": ids}instead of just{ids}{ "ids": ids }and{ids}are identical.