You need to sign in to do that
Don't have an account?
ManojKumar Muthu
Hi,
I am trying to list all case created to particular account here the parameter is the AccountId, below the apex code,
@RestResource(urlMapping='/CaseAccountid/*')
global with sharing class CaseAccountid{
@HttpGet
global static List<Case> getCaseById() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String emailAddress = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
List<case> result = [Select id, subject, status, Version__c, type, priority, AccountId, OwnerId, CSM_ID__c, ContactEmail from Case where AccountId = :ID];
return result;
}
}
I get Error: Compile Error: Variable does not exist: AccountId at line 9 column 170
Can someone help me on this asap.
Thanks in advance.
Apex Code for customer Rest API
Hi,
I am trying to list all case created to particular account here the parameter is the AccountId, below the apex code,
@RestResource(urlMapping='/CaseAccountid/*')
global with sharing class CaseAccountid{
@HttpGet
global static List<Case> getCaseById() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String emailAddress = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
List<case> result = [Select id, subject, status, Version__c, type, priority, AccountId, OwnerId, CSM_ID__c, ContactEmail from Case where AccountId = :ID];
return result;
}
}
I get Error: Compile Error: Variable does not exist: AccountId at line 9 column 170
Can someone help me on this asap.
Thanks in advance.
@RestResource(urlMapping='/CaseAccountid/*')
global with sharing class CaseAccountid{
@HttpGet
global static List<Case> getCaseById() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String ID= req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
List<case> result = [Select id, subject, AccountId, OwnerId, ContactEmail from Case where AccountId = :ID];
return result;
}
}
Please mark it best if it helps you. Thanks in advance.
Regards,
Pawan Kumar
All Answers
@RestResource(urlMapping='/CaseAccountid/*')
global with sharing class CaseAccountid{
@HttpGet
global static List<Case> getCaseById() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String ID= req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
List<case> result = [Select id, subject, AccountId, OwnerId, ContactEmail from Case where AccountId = :ID];
return result;
}
}
Please mark it best if it helps you. Thanks in advance.
Regards,
Pawan Kumar
thanks for the timely help, and again thanks a ton.
Same like the above, now I am trying to see all notes related to a Case, but it returns no value,
below the code,
RestResource(urlMapping='/NotesListView/*')
global with sharing class NotesListView{
@HttpGet
global static List<Note> getNoteById() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String Id= req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
List<Note> result = [Select Id, Title, Body from Note where ParentId= :Id];
return result;
}
}
In partnerid I pass caseid
Kindly find the below Link
https://developer.salesforce.com/forums/ForumsMain?id=9060G0000005hVrQAI#!/feedtype=SINGLE_QUESTION_DETAIL&dc=Developer_Forums&criteria=OPENQUESTIONS&id=9060G0000005iaYQAQ