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
bhagibhagi 

Is it Possible to Schedule the tasks

Hi All,

 

Is it possible to schedule the Tasks..

 

 

Can you suggest me please??

 

Thanks&Regards

Bhagi

HariDineshHariDinesh

Hi,

 

You can’t schedule a task when you create a task from standard SF User interface.

But there is work around for this. It needs to be implemented from Apex Coding.

 

The steps for this is

1)      Create an Apex class which can be schedulable (implement schedulable interface).

2)      Write code to create a task in a method and call that method from somewhere.

3)      Then schedule the class so that the task will be created and assigned as you required.

This is one way of achieving the scheduling the tasks.

 

Or you can write separate class and method to create task and call that class from a scheduler class.

 

Find the Below simple Apex code to create task

Task t = new Task(Subject = 'Task name' , Description =  'test' , Priority = 'low' , IsReminderSet = true , ReminderDateTime = System.now() ,Status = 'Not Started' , OwnerID = ownerID);
Database.DMLOptions dlo = new Database.DMLOptions();
dlo.emailHeader.triggerUserEmail = true;
database.insert(t,dlo);