You need to sign in to do that
Don't have an account?
Keith Stephens 18
create a class to call soql and pass json to my rest service
Hello All,
How do I write a simple Salesforce class that will execute this soql "SELECT LastModifiedDate,Plaintiff_Full_Name__c,Plaintiff_Last_Name__c FROM Case limit 3"
And return a Json string so I can pass that to my C# rest service.
And for testing sake call the class from the Developer Console.
Thanks for any help, I am learning SF as I go.
Keith.
How do I write a simple Salesforce class that will execute this soql "SELECT LastModifiedDate,Plaintiff_Full_Name__c,Plaintiff_Last_Name__c FROM Case limit 3"
And return a Json string so I can pass that to my C# rest service.
And for testing sake call the class from the Developer Console.
Thanks for any help, I am learning SF as I go.
Keith.
global with sharing class mycls {
@HttpGet
global static List<Case> getRecord() {
List<Case> result = [//you query//];
return result;
}
}
and check it through workbench by using url(/services/apexrest/any name/) in the rest explorer, you will see the JSON response
End result is I have a button on the case page that when clicked with call my SF class run the query pass the results to my rest service to be inserted into sql server.