function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
:) :) :) :) :):) :) :) :) :) 

Trigger to create task on account object

I am not getting any error but it doen't creat any task we create or update account record.

 

trigger CreateFlowupTask on Account (after insert,after update) {

   List <task> taskToInsert = new List <task> ();

   for (Account a : Trigger.new) {
   
   task t = new task ();
   t.ActivityDate = a.ship_date__c; // and so on so forth untill you map all the fields.
   t.Subject = 'please call me';
   t.OwnerId = a.OwnerId;
   t.WhatId = a.id;
   taskToInsert.add(t);
}
}

b-Forceb-Force
trigger CreateFlowupTask on Account (after insert,after update) {

   List <task> taskToInsert = new List <task> ();

   for (Account a : Trigger.new) {
   
   task t = new task ();
   t.ActivityDate = a.ship_date__c; // and so on so forth untill you map all the fields.
   t.Subject = 'please call me';
   t.OwnerId = a.OwnerId;
   t.WhatId = a.id;
   taskToInsert.add(t);
}
insert taskToInsert;
}