fork download
  1. Trigger Opportunity trigger on Opportunity(after Update){
  2.  
  3. if(trigger.isupdate && trigger.isAfter){
  4. set<Id> accIDs = new Set<ID>();
  5. for(Opportunity o : trigger.new()){
  6. if(o.status ==Closed){
  7.  
  8. accIDs.add(o.Account);
  9. }
  10. }
  11. List <Account> accList = [Select Id, Status FROM Account WHERE Id in : accIDs];
  12. List <Account> accList1 = new List<Account>();
  13. for(Account a : accList){
  14. a.Status = Closed
  15. accList1.add(a);
  16. }
  17. if(accList1.size()>0){
  18. update accList1
  19. }
  20. }
  21. }
Success #stdin #stdout #stderr 0.02s 10000KB
stdin
Standard input is empty
stdout
Object: nil error: did not understand #Opportunity
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject(Object)>>doesNotUnderstand: #Opportunity (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
Object: nil error: did not understand #Update
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject(Object)>>doesNotUnderstand: #Update (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:3: parse error, expected '}'
./prog:6: Invalid character 0xe2
./prog:6: Invalid character 0x80
./prog:6: Invalid character 0x98
./prog:6: Invalid character 0xe2
./prog:6: Invalid character 0x80
./prog:6: Invalid character 0x99