trigger OpportunityHandler on opportunity(after insert,after update)
{
set<id> setid=new set<id>();
list<Account> acclist=new list<Account>();
for(opportunity opp:trigger.new)
{
setid.add(opp.Accountid);
acclist =[select id,Name from Account where id in:setid];
if(opp.StageName=='Closed Won')
{
for(Account acc:acclist)
{
acc.Rating='Hot';
}
update acclist;
}
}
}
No comments:
Post a Comment