+ Start a Discussion
RJ12RJ12 

Scheduler to send Task and Email alert

If a record is in Lead Status 'Working' and untouched(didn't edit) for 3 business days, I have to send a Task and Email to Lead owner and Manager (user lookup in Lead).

I tried with time-based workflow and process builder but it is not working properly. I believe this is can be done using Scheduler.

1. Can anyone help me how to achieve this using Apex Scheduler?

2. I have created Task and Email Alert in workflow actions. Is it possible to trigger them with scheduler Apex?

GrumpyDevGrumpyDev
HI RJ12,

This might help you : 
 
public void start() {
      Map<String, Object> myMap = new Map<String, Object>();
      myMap.put('v1', input);
      myFlow = new Flow.Interview.doubler(myMap);
      myFlow.start();
   }
Source : 
https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_distribute_system_apex.htm