You need to sign in to do that
Don't have an account?

how to Excute this class please help me
Hi to all,
How to Excute this class please help me
@RestResource(urlMapping='/Merchandise/*')
global with sharing class MerchandiseManager {
@HttpGet
global static Account getMerchandiseById() {
RestRequest req = RestContext.request;
String merchId = req.requestURI.substring(
req.requestURI.lastIndexOf('/')+1);
Account result =
[SELECT Name,NumberofLocations__c,DunsNumber,Description
FROM Account];
return result;
}
@HttpPost
global static String createMerchandise(String name,
String description, Decimal price, Double inventory) {
Account m = new Account(
Name=name,
Description=description,
NumberofLocations__c=price);
//DunsNumber=inventory);
insert m;
return m.Id;
}
}
thanks
kullaia
How to Excute this class please help me
@RestResource(urlMapping='/Merchandise/*')
global with sharing class MerchandiseManager {
@HttpGet
global static Account getMerchandiseById() {
RestRequest req = RestContext.request;
String merchId = req.requestURI.substring(
req.requestURI.lastIndexOf('/')+1);
Account result =
[SELECT Name,NumberofLocations__c,DunsNumber,Description
FROM Account];
return result;
}
@HttpPost
global static String createMerchandise(String name,
String description, Decimal price, Double inventory) {
Account m = new Account(
Name=name,
Description=description,
NumberofLocations__c=price);
//DunsNumber=inventory);
insert m;
return m.Id;
}
}
thanks
kullaia
1) http://amitsalesforce.blogspot.com/2016/06/rest-explorer-using-workbench-execute.html
2) http://amitsalesforce.blogspot.com/search/label/Rest%20API
3) http://amitsalesforce.blogspot.com/2016/04/rest-api-in-salesforce-execute-rest-api.html
Let us know if this will help you