Assign a task using Apex
public class TasKcreation {
public TasKcreation(){
String Userid=UserInfo.getUserId();
Contact c=new Contact(lastname='asasaa111');
insert c;
Task newTask = new Task(Description = 'Survey Transaction',
Priority = 'Normal',
Status = 'Inbound Email',
Subject = 'Other',
IsReminderSet = true,
ReminderDateTime = System.now()+1,
WhoId = c.id,
OwnerId=Userid);
insert newTask;
}
}
public TasKcreation(){
String Userid=UserInfo.getUserId();
Contact c=new Contact(lastname='asasaa111');
insert c;
Task newTask = new Task(Description = 'Survey Transaction',
Priority = 'Normal',
Status = 'Inbound Email',
Subject = 'Other',
IsReminderSet = true,
ReminderDateTime = System.now()+1,
WhoId = c.id,
OwnerId=Userid);
insert newTask;
}
}
Comments
Post a Comment