Sample Code:
Task T = new Task();
T.Type = 'Email';
T.Description = ''; //string
T.OwnerId = ''; //user id
T.WhatId = ''; //record id
insert T;
Task T = new Task();
T.Type = 'Email';
T.Description = ''; //string
T.OwnerId = ''; //user id
T.WhatId = ''; //record id
insert T;
Cheers!!!
HI, can you tell me how to assign a single task to a particular ROLE having multiple users.
ReplyDeleteCoz i have tried T.OwnerId=' role id'; but this is not working.
can you help me here?
Use the below link
Deletehttp://www.infallibletechie.com/2014/11/how-to-query-user-information-from-role.html
Create list of tasks with OwnderId from the above.
Cheers!!!