I have this code that creates a task when opportunity is closed won, however it needs to be assigned to one specific person only.
trigger ClosedOpportunityTrigger on Opportunity (after insert, after update)
{
List<Task> tasks = new List<Task>();
for (Opportunity Opp : Trigger.new)
{
if(Opp.StageName == 'Closed Won')
{
Task tsk = new Task(whatID = Opp.ID, subject='Follow Up Test Task');
tasks.add(tsk);
}
}
insert tasks;
}
What am I missing? Thanks