Favoritehema priya (.qr) asked in #ApexMar 19, 2016, 6:49 AMHi Anyone please help me out of this error@RestResource(urlMapping='/WSItemMasterProductFacilities')global class WSItemMasterProductFacilities { @HttpPost global static Response ItemMasterProductFacilities() { RestRequest req = RestContext.request; RestResponse restRes = RestContext.response; Response res = new Response('ItemMasterProductFacilities'); //Headers from request String accountId = req.headers.get('Account-ID'); System.debug('accountId in WSBorrowerReports = '+accountId); if(accountId == null) { //res.errorCode = peer.Constants.INVALID_INPUT; res.status = peer.Constants.ERROR; res.message = 'ACCOUNT_ID_NOT_PRESENT_IN_HEADER'; restRes.statuscode = peer.Constants.HTTP_BAD_REQUEST; return res; } try { String j; //String NameValue = req.params.get('name'); List <PBSI__PBSI_Item__c> itemMasterList = new List<PBSI__PBSI_Item__c>(); PBSI__PBSI_Item__c loanDisbursalTrans; WrapperItemMasterparticipatedList ItemTrans = new WrapperItemMasterparticipatedList(); List<WrapperItemMasterparticipatedList> ItemTransData = new List<WrapperItemMasterparticipatedList>(); itemMasterList = [Select id,Name from PBSI__PBSI_Item__c]; for(j=0;j<itemMasterList.size();j++) { ItemTrans = new WrapperItemMasterparticipatedList(); loanDisbursalTrans = itemMasterList.get(j); ItemTrans.entity_id = loanDisbursalTrans.name; ItemTransData.add(ItemTrans); } //Sending Response res.ItemTransData = ItemTransData; // restRes.statuscode = peer.Constants.HTTP_OK; res.status = peer.Constants.SUCCESS; return res; } catch (Exception e) { System.debug('Exception e is ='+e); res.errorCode = 'Line number= '+e.getLineNumber()+' Message is= ' +e.getmessage(); res.status = peer.Constants.ERROR; res.message = 'Internal Exeption Occurred'; restRes.statuscode = peer.Constants.HTTP_INTERNAL_ERROR; return res; }}}ERROR:Variable does not exist: peer.Constants.INVALID_INPUTShow More10 answersSortSort by DateSort by Most HelpfulSort by DateLoad more comments...Nagendra Chinchinada (Salesforce)Mar 19, 2016, 9:35 AMThis documentation might help you. Go through all topics related to REST in that left side menu.https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_code_sample_basic.htmAdd a commentWrite an answer...BoldItalicUnderlineStrikethroughBulleted ListNumbered ListAdd linkCode blockInsert imageAttach filesLink URLCancelSave0/9000Reply
Nagendra Chinchinada (Salesforce)Mar 19, 2016, 9:35 AMThis documentation might help you. Go through all topics related to REST in that left side menu.https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_code_sample_basic.htm