Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Can you prevent a Dynamic CRM Workflow from sending an email to a Disabled User?

Posted on by Microsoft Employee

I am using Microsoft Dynamic CRM Online and have a workflow issue. When the status of a case is modified, there is a workflow that kicks off to send members of the case team an e-mail. The problem is, it is sending the message to members of the team that have been recently disabled.

Example: User Michael Knight is added to Case KITT123. One week later, Michael's account is marked as disabled. Two months later, the status of the case is updated and a workflow is triggered to send team members an e-mail.  Even though his account is disabled, Michael is still part of the Case Team.

Is there a way inside a workflow to prevent the email from being sent if the user is disabled?

6305.Workflow.PNG

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Can you prevent a Dynamic CRM Workflow from sending an email to a Disabled User?

    The user data is maintained through Office 365 so I am not sure I can edit the email even through a workflow.  I sent the client a message with some extra details to see how they want me to proceed.

    EDIT:  I tried creating a Workflow for USER on the Record Status Changed but it wasn't an option.  So, can't edit through a workflow.

    Thanks for your help Alex!

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Can you prevent a Dynamic CRM Workflow from sending an email to a Disabled User?

    Well, maybe you can simply remove email address from the deactivated user records.. Which means you may have to re-activate them first.. and if you can't reactivate, you can, then, try excel export/import for the email field

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Can you prevent a Dynamic CRM Workflow from sending an email to a Disabled User?

    Yep. The Send Email adds the nine fields from Case to the To Recipients list.  There are three different messages (reminders at different intervals) sent as part of this workflow. That would be an additional 27 checks. That would also mean 27 separate email steps instead of three...not my idea of optimized or a good time :)

    As far as the custom activity, the client has asked us to "limit the amount of custom code" we create for the project.  If anything is done, it would probably be the 27 checks.  

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: Can you prevent a Dynamic CRM Workflow from sending an email to a Disabled User?

    So what you are saying is that the "send email" activity is, basically, using all those case fields you created for different "roles" by adding them to the "to"/"cc" fields of the email being created?

    You might add conditions to the workflow, then, but you'd have to repeat that "send email" step once per field (in every condition, you would say "if case->role 1 user is not disabled" then send an email to case->role 1 user".. for each role.. that would be painful

    Alternatively, you could create a custom workflow activity to send those emails..actually, you could create a plugin on pre-create for emails.. if there is an outgoing email regarding a case, you could clean up "to" field by removing disabled users

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Can you prevent a Dynamic CRM Workflow from sending an email to a Disabled User?

    Unfortunately, it is an out of the box Send Email straight from the Workflow.  The case team set up is complex and uses multiple entities and workflows.  

    1. Case Team Member - Has a user and a role.

    2. Owner Team - Is the team that is assigned to the case.

    3. Case - Has several attributes (fields) to store specific team members for specific roles.

    When a team member is added to Case Team Member, they are added to the owner team as well. If they select a specific role, they are also added to the appropriate field on the Case record via a workflow.  I have logic in this workflow to prevent a disabled user from being added to the Case Records.  

    This fixes part of the problem by stopping them from being added but if they are disabled after they have been added they will still get the message.

    The emails are send based on the fields in the Case record.  

    I may have to go the custom workflow route to remove a user from all cases if they are disabled.  This could be a very, very messy activity though since there are 9 possible fields I would have to check on each case for each user. Right now, there are about 20,000 cases.

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: Can you prevent a Dynamic CRM Workflow from sending an email to a Disabled User?

    Hi Paul,

     are you using some sort of custom workflow activity to send an email to a team? If yes, then it'll be up to that activity to control how the emails are sent - all you can do is ensure that disabled users are removed from the teams (may require another custom workflow activity/plugin.. unless you want to do it manually)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans