function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VRKVRK 

Help on apex issues

Hi 
i am having 2 issus, can u pls help on this :
1. How can i place below data Into Map :
(
        caseInfoWrapper:
        [carrierId=, 
        partyId=a1K2F000000lWJrUAM, 
        product=SI, 
        productType=Whole Life, 
        stateId=AK]
        )

2. When calling Wrapper class from one class to another class getting below error :
Illegal assignment from List<NewCtr.caseInfoWrapper> to List<String>

global class NewCtr {
public static List<caseInfoWrapper> caseInfoWrapperRecords(List<ATD_Application__c> applicationList,Id partyId){
      List<caseInfoWrapper> lsCaseWrappers = new List<caseInfoWrapper>();
        for(ATD_Application__c caseInfo : applicationList){
            caseInfoWrapper wrapper = new caseInfoWrapper();
            wrapper.partyId = caseInfo.Party__c;
            wrapper.productType = 'Whole Life';
            lsCaseWrappers.add(wrapper);
            system.debug('lsCaseWrappers***'+lsCaseWrappers);
        }
        return lsCaseWrappers;
    }
    
    }
    
global with sharing class NewHandler {

    list<caseInfoWrapper> wrapperRecords = NewCtr.caseInfoWrapperRecords(applicationList,partyId);
}
Rajesh3699Rajesh3699
Hi 
change as below, 
list<NewCtr.caseInfoWrapper> wrapperRecords = NewCtr.caseInfoWrapperRecords(applicationList,partyId);

I think the wrapper class caseInfoWrapper is defined in the class NewCtr, so change in accordingly.
It would be better if you share the complete code to check what exactly the error is.

Thank You,
Rajesh Adiga P.

 
Rajesh3699Rajesh3699
Where you have defined the wrapper class, can you share the complete code as it is...