You need to sign in to do that
Don't have an account?
NARAYANA PANAKALA
Hi Team,
Kindly help me with the test class for this code.
Thank you
How to write Test class for this code which i was attached
trigger c1 on contact (Before Insert){ try{ Set<id> AccountIds = new Set<id>(); map<id,Integer> mapAccountPhone=new map<id,Integer>(); for(contact c : trigger.new){ AccountIds.add(c.Accounid); } for(Account AccC:[select Id,phone from Account where id in : AccountIds]) { mapAccountPhone.put(id,phone); } for(contact c1 : trigger.new){ c1.phone = mapAccountPhone.get(c1.AccountId); } } Catch(Exception Err) { System.debug('Exception Occured:'+Err); } }
Hi Team,
Kindly help me with the test class for this code.
Thank you
If it helps please mark as correct, it may help others.