CRM 2011 Custom Workflow Activity - Send Email to Managers

In CRM 2011 (not online), you can create custom workflow activity for things that are not achievable using the OOTB workflow.

In my scenario, I want to send Overdue Case Reminder to group of users (in this case - managers) when a case has reached the Follow Up By date.
If you look at the SystemUser, it has a manager field by default. However, I need to be able to send the email to multiple managers.

My idea is that we create a separate Security Role (e.g. Managers) and put all managers in that role. Then we create a custom workflow activity to get all the users in that role and construct an email to notify them when the case is overdue.



Note: for the CaseLink input, I'm using the CRM 2011 Workflow Utilities to generate the Case Link and put it into the Email Description field.

Hope this helps,
Andreas

8 comments

Hi Andreas,

I'm trying to use your example but I cannot find the reference for ActivityParty. Which assembly I need to add to my solution?

Reply

Hi Cleiton,

ActivityParty is just another strongly typed entity like Account, PhoneCall etc.
If you generate your entities class using the crmsvcutil tool, that class will have ActivityParty entity in it :)

Regards,
Andreas

Reply

Cool stuff. Just out of curiosity, any reason why you used security roles and not teams?

Reply

Hi.

Thanks. Good question. You can surely go with the Team. I can't really remember why role was chosen instead of team, but I can see nothing wrong either way. In fact I reckon if you can use Team it would be cleaner.

Regards,
Andreas

Reply

Does this line of code worked for you [ var activityParty = new List(); //used to add instances]? Please respond

Reply

Sorry please ignore my previous comment, got it now.

List = System.Collections.Generic.List<>

Reply

where to get the assembly of org.entities.crm

Reply

I am regular reader of your blog and no doubt it all stuff is awesome. The best thing about your sharing and posting is that you always provide content that is helpful for both the newbie and experts.CRM Software Development

Reply

Post a Comment