• Dasetti Venkata Ramaiah
  • NEWBIE
  • 25 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi Folks,
 I am writting a wrapper class in which it returns 2 lists.Pls refer the code.
Public class SFDC_Ltng_StakeHolderWrapperClass{
   @AuraEnabled
    Public static SFDC_Ltng_StakeHolderWrapperClass getmethod(){
        SFDC_Ltng_StakeHolderWrapperClass Slswc=new SFDC_Ltng_StakeHolderWrapperClass();
        List<ZenObject__c> ZenobjsEven;
        List<ZenObject__c> ZenobjsOdd;        
        List<ZenObject__c> Zenobjs=[Select ZenLms_Name_del__c,ZenLms_SubText__c from ZenObject__c];
        for(integer i=1;i<=Zenobjs.size();i++){
            if(math.mod(i,2)==0){
                Slswc.ZenobjsEven.addAll(Zenobjs);
               
            }
            else if(math.mod(i,2)!=0)
                Slswc.ZenobjsOdd.addAll(Zenobjs);
            
        }       
       
       return Slswc; 
}
    
}

But i doing some mistake here.As i have less idea on wrapper class.
Critera here is  if(math.mod(i,2)==0){
                            //then i am adding Zenobjs lists to ZenobjsEven
                            else to ZenobjsOdd
}
atlast i need to return 2 lists.
Can anybody help me out here.
Hi Folks,
 I am writting a wrapper class in which it returns 2 lists.Pls refer the code.
Public class SFDC_Ltng_StakeHolderWrapperClass{
   @AuraEnabled
    Public static SFDC_Ltng_StakeHolderWrapperClass getmethod(){
        SFDC_Ltng_StakeHolderWrapperClass Slswc=new SFDC_Ltng_StakeHolderWrapperClass();
        List<ZenObject__c> ZenobjsEven;
        List<ZenObject__c> ZenobjsOdd;        
        List<ZenObject__c> Zenobjs=[Select ZenLms_Name_del__c,ZenLms_SubText__c from ZenObject__c];
        for(integer i=1;i<=Zenobjs.size();i++){
            if(math.mod(i,2)==0){
                Slswc.ZenobjsEven.addAll(Zenobjs);
               
            }
            else if(math.mod(i,2)!=0)
                Slswc.ZenobjsOdd.addAll(Zenobjs);
            
        }       
       
       return Slswc; 
}
    
}

But i doing some mistake here.As i have less idea on wrapper class.
Critera here is  if(math.mod(i,2)==0){
                            //then i am adding Zenobjs lists to ZenobjsEven
                            else to ZenobjsOdd
}
atlast i need to return 2 lists.
Can anybody help me out here.