You need to sign in to do that
Don't have an account?
RAM R
how to call map in the below code?
for(Contact c: contactList){
for(Addresses__c a: addressList){
if(a.Contact__c == c.Id){
if(zipcodeMap.containsKey(string.valueOf(a.Zip_Code__c+''+c.Firm_Channel__c))){
values----------> conZipMap.put(a.Contact__c , zipcodeMap.get(string.valueOf(a.Zip_Code__c+''+c.Firm_Channel__c)));
system.debug('&&&&&' + conZipMap);
system.debug('&&&&&' + a.Zip_Code__c+''+c.Firm_Channel__c);
}
}
}
}
for(Contact c: contactList){
if(!conZipMap.containsKey(c.Zip_Code__c)){
if((c.Firm_Channel__c != null)&&(c.Firm_Channel__c != contactOldMap.get(c.Id).Firm_Channel__c)){
system.debug('*****'+conZipMap.get(c.Zip_Code__c);
--------> c.Zip_Code__c = conZipMap.get(c.Zip_Code__c);-----------> how can i call the above map and assigned that zipcode here
system.debug('&&&&&&&' + c.Zip_Code__c);
system.debug('&&&&&&&' + conZipMap.get(c.Zip_Code__c).Id);
}
}
}
for(Addresses__c a: addressList){
if(a.Contact__c == c.Id){
if(zipcodeMap.containsKey(string.valueOf(a.Zip_Code__c+''+c.Firm_Channel__c))){
values----------> conZipMap.put(a.Contact__c , zipcodeMap.get(string.valueOf(a.Zip_Code__c+''+c.Firm_Channel__c)));
system.debug('&&&&&' + conZipMap);
system.debug('&&&&&' + a.Zip_Code__c+''+c.Firm_Channel__c);
}
}
}
}
for(Contact c: contactList){
if(!conZipMap.containsKey(c.Zip_Code__c)){
if((c.Firm_Channel__c != null)&&(c.Firm_Channel__c != contactOldMap.get(c.Id).Firm_Channel__c)){
system.debug('*****'+conZipMap.get(c.Zip_Code__c);
--------> c.Zip_Code__c = conZipMap.get(c.Zip_Code__c);-----------> how can i call the above map and assigned that zipcode here
system.debug('&&&&&&&' + c.Zip_Code__c);
system.debug('&&&&&&&' + conZipMap.get(c.Zip_Code__c).Id);
}
}
}
At the time of creating map , you are using "a.contact__c" as a key. So if you need to get the value of from map then you need to provide id of contact.
-Thanks
Ashlk