Notes
HTTP Delete Method (@HTTPDelete
)
@RestResource(urlMapping='/FieldCase/*')
global class RestCaseController {
@HTTPDelete
global static List<Case> deleteRelatedCases(){
String AccountName = RestContext.request.params.get('AcName');
Account ac = [SELECT Id, Name FROM Account WHERE Name =:AccountName];
List<Case> relatedCases =[SELECT Id, Subject, Status FROM case
WHERE AccountId=:ac.Id];
delete relatedCases;
return relatedCases;
}
}