我创建了一种更新案例记录的方法。
@RestResource(urlMapping= '/FieldCases/*')
global with sharing class RestCaseController {
@HttpPatch
global static String caseUpdate(String caseId, String caseStatus, String caseNote){
Case companyCase = [SELECT Id, Subject, Status, Description FROM Case WHERE Id = :caseId];
companyCase.Status = caseStatus;
companyCase.Description += caseNote;
update companyCase;
Return 'Updated';
}
}
在工作台我正在使用
/服务/ apexrest / FieldCases
{"caseId" : "0037F00000bQYIjQAO",
"caseStatus" : "Working",
"caseNote" : "updating from the work bench"}
但我收到以下错误
HTTP方法' PATCH'不允许。允许使用POST,DELETE,GET,HEAD