function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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