Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. trigger coursetrigger on Account (after insert, after update)
  2. {
  3. if((trigger.isinsert||trigger.isupdate) && trigger.isafter)
  4. {
  5. list<contact> lstcon = new list<contact>();
  6. for(account acc:trigger.new)
  7. {
  8. course__c c1= new course__c();
  9. if(acc.course_name__c == c1.name)
  10. {
  11. contact con= new contact();
  12. con.LastName='pa';
  13. con.AccountId=acc.id;
  14. lstcon.add(con);
  15. }
  16. if(!lstcon.isempty())
  17. {
  18. insert lstcon;
  19. }
  20. }
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement