You need to sign in to do that
Don't have an account?
VRK
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);
}
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);
}
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.