
Hi Manoj,Greetings to you!In your code, you are using List<Case> as return type but the SOSL always return the List of List of sobjects like List<List<Case>> If you will change the return type to List<List<Case>> in your code that will work.global static List<List<Case>> getCase() { ... }Try below code:
I hope it helps you.Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.@RestResource(urlMapping='/Casequery/*')
global with sharing class CaseQuery {
@HttpGet
global static List<List<Case>> getCase() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String Id = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
List<List<Case>> results = [FIND 'map*' IN ALL FIELDS RETURNING Case (id, Call_Back_Type__c, IsEscalated,
Case_Owner_Name__c, OwneEmail__c, subject, Case_Type__c,
Code__c, Tracker__c, status, Version__c, type, priority, ContactEmail,
ContactId, OwnerId, CaseNumber)];
return results;
}
}
Thanks and Regards,
Khan Anas