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

Comments

  1. 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?

    ReplyDelete
    Replies
    1. 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

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

    ReplyDelete
    Replies
    1. 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

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

    ReplyDelete
  4. Sorry please ignore my previous comment, got it now.

    List = System.Collections.Generic.List<>

    ReplyDelete

Post a Comment

Popular posts from this blog

SharePoint 2013 anonymous access add attachments to list item

Sitecore custom publish agent from specific node and at a specific time

CRM Plugin - Parent and Child Pipeline