Guest User

Untitled

a guest
Apr 25th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public void updaterating(List<Opportunity> oppor)
  2. {
  3. Map<Id,Account> accountMap = new Map<Id,Account>();
  4.  
  5. for(Opportunity o : oppor){
  6.  
  7. if(o.StageName == 'Closed Won'){
  8. accountMap.put(o.Id, new Account(Id=o.AccountId, rating='Hot',site = o.StageName));
  9. }
  10. system.debug('TEstKNocky' + accountmap);
  11. }
  12. //Update all the appropriate accounts in a bulkified manner here.
  13. if(accountMap.size() > 0)
  14. {
  15. update accountMap.values();
  16. }
  17. }
Add Comment
Please, Sign In to add comment