• Sri Hari Nadendla
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hello all,

I am unable to insert more than 32 parameters in @httpPost method Please suggest me a better way in order to insert more parameters
Below Is my code:
@RestResource(urlMapping='/Students/*')
global with sharing class Studnets {

   
    
     @HttpPost
    global static String doPost(Integer Max,String ConcurrentAsyncGetReportInstances,String ConcurrentSyncReportRuns,Integer Max1,
    Integer Remaining,Integer Remaining1,String DailApiRequest,Integer DAPIRemaining,Integer DAPiMax,String Ant,Integer AntMax,
    Integer AntRemaining,String App,Integer AppMax,Integer AppRemaining,String DataloaderBulk,Integer DMax,Integer DRemaining,String DPartner,
    Integer DPMax,Integer DpRemaining,String FIde,Integer Fmax,Integer FRemaining,String SFMD,Integer SFMDMax,Integer SFMDRemaining,String SFTouch,Integer SFTMax,
    Integer SFTRemaining,Integer SFOMax,Integer SFORemaining,String SFOutlook)
     {
        System.debug('Entering in to APIUSAGE__c');
        APIUSAGE__c  st = new   APIUSAGE__c();
        st.ConcurrentAsync__c=ConcurrentAsyncGetReportInstances;
        st.ConcurrentSync__c=ConcurrentSyncReportRuns;
        st.Async_Max__c=Max;
        st.Max__c=Max1;
        st.SyncRemaining__c=Remaining;
        st.Async_Remaining__c=Remaining1;
        st.DailyApiRequests__c=DailApiRequest;
        st.DAPIRemaining__c=DAPIRemaining;
        st.DAPiMax__c=DAPiMax;
        st.Ant_Migration_Tool__c=Ant;
        st.Ant_Max__c=AntMax;
        st.Ant_Remaining__c=AntRemaining;
        st.App_Name__c=App;
        st.App_Max__c=AppMax;
        st.App_Remaining__c=AppRemaining;
        st.Dataloader_Bulk__c=DataloaderBulk;
        st.DMax__c=DMax;
        st.DRemaining__c=DRemaining;
        st.Dataloader_Partner__c=DPartner;
        st.DPMax__c=DPMax;
        st.DpRemaining__c=DpRemaining;
        st.ForceIDE__c=FIde;
        st.FMax__c=Fmax;
        st.FRemaining__c=FRemaining;
        st.SFMD__c=SFMD;
        st.SFMDMax__c=SFMDMax;
        st.SFMDRemaining__c=SFMDRemaining;
        st.SFTouch__c=SFTouch;
        st.SFTMax__c=SFTMax;
        st.SFTRemaining__c=SFTRemaining;
        st.SFOMax__c=SFOMax;
        st.SFOutlook__c=SFOutlook;
        st.SFORemaining__c=SFORemaining;
        
        
        
        insert st;
        return st.Id;
    }
    
    
 
}
Hello all,

I am unable to insert more than 32 parameters in @httpPost method Please suggest me a better way in order to insert more parameters
Below Is my code:
@RestResource(urlMapping='/Students/*')
global with sharing class Studnets {

   
    
     @HttpPost
    global static String doPost(Integer Max,String ConcurrentAsyncGetReportInstances,String ConcurrentSyncReportRuns,Integer Max1,
    Integer Remaining,Integer Remaining1,String DailApiRequest,Integer DAPIRemaining,Integer DAPiMax,String Ant,Integer AntMax,
    Integer AntRemaining,String App,Integer AppMax,Integer AppRemaining,String DataloaderBulk,Integer DMax,Integer DRemaining,String DPartner,
    Integer DPMax,Integer DpRemaining,String FIde,Integer Fmax,Integer FRemaining,String SFMD,Integer SFMDMax,Integer SFMDRemaining,String SFTouch,Integer SFTMax,
    Integer SFTRemaining,Integer SFOMax,Integer SFORemaining,String SFOutlook)
     {
        System.debug('Entering in to APIUSAGE__c');
        APIUSAGE__c  st = new   APIUSAGE__c();
        st.ConcurrentAsync__c=ConcurrentAsyncGetReportInstances;
        st.ConcurrentSync__c=ConcurrentSyncReportRuns;
        st.Async_Max__c=Max;
        st.Max__c=Max1;
        st.SyncRemaining__c=Remaining;
        st.Async_Remaining__c=Remaining1;
        st.DailyApiRequests__c=DailApiRequest;
        st.DAPIRemaining__c=DAPIRemaining;
        st.DAPiMax__c=DAPiMax;
        st.Ant_Migration_Tool__c=Ant;
        st.Ant_Max__c=AntMax;
        st.Ant_Remaining__c=AntRemaining;
        st.App_Name__c=App;
        st.App_Max__c=AppMax;
        st.App_Remaining__c=AppRemaining;
        st.Dataloader_Bulk__c=DataloaderBulk;
        st.DMax__c=DMax;
        st.DRemaining__c=DRemaining;
        st.Dataloader_Partner__c=DPartner;
        st.DPMax__c=DPMax;
        st.DpRemaining__c=DpRemaining;
        st.ForceIDE__c=FIde;
        st.FMax__c=Fmax;
        st.FRemaining__c=FRemaining;
        st.SFMD__c=SFMD;
        st.SFMDMax__c=SFMDMax;
        st.SFMDRemaining__c=SFMDRemaining;
        st.SFTouch__c=SFTouch;
        st.SFTMax__c=SFTMax;
        st.SFTRemaining__c=SFTRemaining;
        st.SFOMax__c=SFOMax;
        st.SFOutlook__c=SFOutlook;
        st.SFORemaining__c=SFORemaining;
        
        
        
        insert st;
        return st.Id;
    }
    
    
 
}