I have a scenario where I have to create an automation on opportunity. When opportunity on stage 1 for more than 14 days & there are no open task in opportunity & last activity age should be more than 12 days so an email reminder goes to opportunity’s owner to remind him/her to move the opportunity to stage 2. Same with stage 2 to 3 and 3 to 4. I tried to achieve it through workflow and put the criteria: 1. Opportunity stage equal to prospecting 2. Open task count equal to 0 ( I have created a custom number field to update it through trigger to count the open task) 3. Last activity age >= 12 ( last activity age is a custom filed and count last activity age)
Workflow evaluation criteria set as “Created and edited to subsequently meet the criteria”
The problem here is we have many opportunities which are untouched from long time and to meet with the criteria either I need to edit them on by one or need to update through data loader. If I created a new record and keep it as it is untouched for long time it will not catch by workflow rule because on creation time it doesn’t meet the criteria and after when record is eligible to meet the criteria I have to edit it to meet the criteria.
I want anything like batch or trigger to keep checking opportunity records and whenever any record comes under the criteria. An email goes to opportunity owner.
Any approach and help appreciated.