You need to sign in to do that
Don't have an account?
Krishna Sahu 1
Please help to write test class on after update trigger
public static void mapBirthdayFieldsOnEducationSession(map<Id,Lead> newLeadMap, map<Id,Lead> oldLeadMap){
map<Id,Lead> newConvertedIdMap = new map<Id,Lead>();
for(Lead listLead : newLeadMap.values()){
if(listLead.isConverted && listLead.ConvertedAccountId !=null && listLead.HealthCloudGA__BirthDate__c !=null){
newConvertedIdMap.put(listLead.ConvertedAccountId,listLead );
}
}
if(!newConvertedIdMap.isEmpty()){
List<Account> listAccount = [SELECT Id , PersonBirthdate FROM Account WHERE Id IN : newConvertedIdMap.keySet()];
for(Account account : listAccount){
Account.PersonBirthdate = newConvertedIdMap.get(account.Id).HealthCloudGA__BirthDate__c;
}
update listAccount ;
}
}
map<Id,Lead> newConvertedIdMap = new map<Id,Lead>();
for(Lead listLead : newLeadMap.values()){
if(listLead.isConverted && listLead.ConvertedAccountId !=null && listLead.HealthCloudGA__BirthDate__c !=null){
newConvertedIdMap.put(listLead.ConvertedAccountId,listLead );
}
}
if(!newConvertedIdMap.isEmpty()){
List<Account> listAccount = [SELECT Id , PersonBirthdate FROM Account WHERE Id IN : newConvertedIdMap.keySet()];
for(Account account : listAccount){
Account.PersonBirthdate = newConvertedIdMap.get(account.Id).HealthCloudGA__BirthDate__c;
}
update listAccount ;
}
}
Try Below Code Please Mark It As best Answer If It Helps
Thank You!
Your code is not working
Refer the below link.
https://developer.salesforce.com/forums/?id=9060G000000I6VnQAK
Thanks!!