fork download
  1. trigger CreateContactsOnAccountCreationTrigger on Account (after insert) {
  2.  
  3. // Loop through the newly inserted Accounts
  4. for (Account account : Trigger.new) {
  5.  
  6. // Create 3 Contacts with the same name as the Account
  7. for (Integer i = 1; i <= 3; i++) {
  8. Contact newContact = new Contact();
  9. newContact.LastName = account.Name;
  10. newContact.AccountId = account.Id;
  11. insert newContact;
  12. }
  13. }
  14. }
  15.  
Success #stdin #stdout #stderr 0.01s 10104KB
stdin
Standard input is empty
stdout
Object: nil error: did not understand #CreateContactsOnAccountCreationTrigger
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject(Object)>>doesNotUnderstand: #CreateContactsOnAccountCreationTrigger (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
Object: nil error: did not understand #insert
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject(Object)>>doesNotUnderstand: #insert (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:3: parse error, expected '}'