Hi CRM Masters!
A seemingly easy task here but I'm struggling for 2 days already.
Need to create a scheduled Workflow (or alternative method) that sends emails to the respective Opportunity Owner IF the Owner has overdue Opportunities (preferably but optional - add number of such Opportunities in the email message).
As I understand the logic should be this:
- create scheduled workflow (daily/weekly/whatever)
- loop through all the Opportunity Owners, check if any of them have 1 or more overdue Opportunities (and preferably count them)
- send emails one by one to the respective Owners containing link to a view "Overdue Opportunities" (and preferably indicate how many).
I can't figure out and will appreciate any ideas on these points:
- How to loop through all the Opportunity Owners and count overdue Opportunities for each of them? It could be either a specific hidden field on Owner that contains this number or it could be a parameter that is passed to workflow, but how do I perform this counting for every user who has open Opportunities? Creating separate workflow for every user doesn't really make sense as there are many users and they are changing. There should be some kind of solution ... but I don't see it.
- How to send emails to the respective Opportunity Owners about their specific Opportunities? Presumably solution could be same as for the previous point - loop through all Users and if the overdue Opportunity indicator is>0 then send the email. But how to loop through them?
This should be done without involving developers, so - workflows, views, FetchXML, things like that.
I have a feeling I'm overlooking something, feels like the solution should be rather easy.
Thanks in advance for any ideas!