+ Start a Discussion
sony2503@gmail.comsony2503@gmail.com 

Problem in getting series of recurring Task

Hi,

 

I have created a recurring task through apex class now i want to get whole series of created recurring task.

How can i get that series

in apex class?

Urgent.

 

Thanks,

Soni

AmulAmul
use following option:

Database.SaveResult sr = Database.insert(jobShr,false);
// Process the save results.
if(sr.isSuccess()){
// Indicates success
for(Database.SaveResult result:sr) {
if (result.isSuccess()){
system.debug('Record Ids-------->' + result.getId());
}

}
return true;
}
JohnSchultzJohnSchultz

There is a field on the Task object called RecurrenceActivityId. That field holds the ID of the first of the recurring tasks. If you can get the first task's ID, then you can query for all tasks that have that ID in the RecurrenceActivityId field, which should return the whole series.