You need to sign in to do that
Don't have an account?
sales@myvarma
Illegal assignment from Map<Id,Account> to Map<Id,account>
trigger updateact on Account(before update) { List<ID> accs=new List<ID>(); Map<Id,Account> oldMap=Trigger.oldMap; Map<Id,Account> newMap=Trigger.NewMap; for(Id aid:oldMap.keySet()) { if(oldMap.get(aid).AccountNumber!=newMap.get(aid).AccountNumberr) { accs.AccountNumber.addError(' Please contact Master Data to make this change.'); } } }
Please try with this code snippet,
you don't have to create two other maps for this requirement. However, I would like to suggest you to used trigger handlers instead of writing the whole code into the trigger. Thats the best practise.
If this code solve your problem please make it as best answer.
Thanks,
Prosenjit.
variable does not exist : AccountNumber
try this code
surely it gonna help you
Please choose as best answer :)
Thanks
I had done a typo on this line oldAccount.AccountNumber != acc.AccountNumberr .
Please use this code,
Thanks,
Prosenjit
Please check in your org you have any apex class with Account Name ? If yes then please rename that class or delete same class .
Please try to update your code like below
Let us know if this will help you