fork download
  1. trigger OpportunityTracking on Opportunity (after update) {
  2. for (Opportunity opp : Trigger.new) {
  3. if (opp.StageName == 'Closed Won' &&
  4. Trigger.oldMap.get(opp.Id).StageName != 'Closed Won') {
  5. Performance_Tracker__c tracker = new Performance_Tracker__c(
  6. Sales_Rep__c = opp.OwnerId,
  7. Opportunity_Amount__c = opp.Amount,
  8. Close_Date__c = opp.CloseDate
  9. );
  10. insert tracker;
  11. }
  12. }
  13. }
  14.  
Success #stdin #stdout #stderr 0.02s 10132KB
stdin
Standard input is empty
stdout
Object: nil error: did not understand #OpportunityTracking
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject(Object)>>doesNotUnderstand: #OpportunityTracking (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:2: parse error, expected '}'
./prog:4: expected expression