Skip to main content
@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_INPUT
10 answers
0/9000