Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trigger coursetrigger on Account (after insert, after update)
- {
- if((trigger.isinsert||trigger.isupdate) && trigger.isafter)
- {
- list<contact> lstcon = new list<contact>();
- for(account acc:trigger.new)
- {
- course__c c1= new course__c();
- if(acc.course_name__c == c1.name)
- {
- contact con= new contact();
- con.LastName='pa';
- con.AccountId=acc.id;
- lstcon.add(con);
- }
- if(!lstcon.isempty())
- {
- insert lstcon;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement