Restricting the user to create duplicate email(Contact) for a particular account
Apex class -------------- public class DuplicationOnContact { public static void doDuplicateCheck(List<Contact> conlist){ Map<String,String> mapcon=new Map<String,String>(); set<String> setacc=new set<String>(); for(Contact con:conlist){ if(con.AccountId!=null) setacc.add(con.AccountId); } for(Contact con:[select Id,Name,Email,AccountId from Contact where AccountId=:setacc]){ mapcon.put(con.Email,con.AccountId); } for(Contact con:conlist){ if(!mapcon.isEmpty() && mapcon.containskey(con.Email)){ con.addError('Please enter un...