https://trailhead.salesforce.com/content/learn/modules/apex_triggers/apex_triggers_bulk
This is the code I have typed
trigger ClosedOpportunityTrigger on Opportunity (after insert,after update) { List<Task> taskList=new List<Task>(); for(Opportunity Opp:Trigger.New){ if(Trigger.isInsert || Trigger.isUpdate){ if (opp.StageName =='Closed Won'){ task t = new task(); t.whatID = opp.id; t.Subject='Follow Up Test Task'; taskList.add(t); } } }
if(taskList.size()>0) insert taskList; }
And I am now facing this error. I hope there is anyone to help me out with this error :)
4 Antworten