Wednesday, October 01, 2014

If do not want Exception then use this code

Map<id,Contact> mpFinal=new Map<id,Contact>();
for(Contact obj:myList)
 {
  mpFinal.put(obj.id,obj);
 }
myList.clear();
for(ID objID:mpFinal.keySet())
 {
  myList.add(mpFinal.get(objID));
 }

No comments:

Post a Comment

Thanks for your comment