+ Start a Discussion
viswsanathviswsanath 

Error: Compile Error: Illegal assignment from Map<Id,Contact> to Map<Id,viswa.Contact> at line 3 column 5


HI ALL
I got the below error canu pls resolve me .
Error: Compile Error: Illegal assignment from Map<Id,Contact> to Map<Id,viswa.Contact> at line 3 column 5



trigger Email_Check_On_Contact on Contact (before update) {
  Map<Id,Contact> o = new Map<Id,Contact>();
    o = trigger.oldMap;
    for(Contact newcont: trigger.new)
    {
      
        if(newcont.Email != o.get(newcont.Id).Email)
        {
            newcont.Email.addError('Email cannot be changed');
        }
    }
}
Chandu sekharChandu sekhar
Hi vishwa,

It is working fine.Could you please check.

Thanks
 
viswsanathviswsanath
Thanks Sekhar