Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Workflow that e-mails N:N related users/accounts

Posted on by Microsoft Employee

Hi all. I have an entity that contains data, and has N:N relations to users and customer entities. I'd like a workflow that could e-mail all users on a relation. For example, e-mail all business owners related to this action. I do not see any of my N:N relations in the form assistant however. Am I missing something, or is there some way to do this?

*This post is locked for comments

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: Workflow that e-mails N:N related users/accounts

    For the proof of concept, you might try the approach described here:

    www.itaintboring.com/.../dynamics-crm-tcs-tools-user-a-workflow-to-update-related-entities

    (that's another toolkit for CRM, btw:)) )

    Create a fetchxml to query all those users through your N:N relationship (use your "parent" entity id as a parameter), then just do this:

    - Create a lookup field on the user entity (a lookup to the N:N "parent" entity)

    - Assign that lookup using the approach described at the link above

    - Create a separate workflow to send an email whenever that field is modified (you'll have a "temporary" parent in the lookup field, and you'll be able to use it for the emails)

    (Actually, I'm pretty sure you can do something similar with Andrii's toolkit as well)

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Workflow that e-mails N:N related users/accounts

    It is what it is. I'm afraid you will not resolve that issue without coding. I believe it can be resolved with custom workflow activity developed for your specific scenario.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Workflow that e-mails N:N related users/accounts

    I'm working primarily with on-demand workflows. I would just like to e-mail everyone related to an entity with relevant information about that entity, such as letting all business owners know that their application has been accepted. Seems strange that CRM doesn't support what is basically an e-mail list.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Workflow that e-mails N:N related users/accounts

    I don't think that this would work for your customization. When you distribute workflow through N-N relationship there is no way to define what cause triggering of that workflow. You can easily define parent in 1-N relationship but not for N-N relationship.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Workflow that e-mails N:N related users/accounts

    Thank you for your help! I've got the workflow working, but I have another (final?) question. First, thank you for creating the workflow solution! There are a lot of useful tools in there.

    I do apologize if I'm missing something simple, I'm new to the Dynamics CRM world and am building a proof of concept to see if all the features my team wants will work, and then they might dedicate resources to it later.

    So my last issue is that after the workflow is distrubuted from my data entity to my user entities, how do I still access the 'parent' record? For example, an email:

    To: User(User)
    
    From : $service_account
    
    Dear {Fullname(User)},
    
    This is an e-mail regarding {Application_name(Service)}


    Thank you again for all your help!

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Workflow that e-mails N:N related users/accounts

    Hello,

    Pass Record Dynamic URL of that entity. In parametrizing I used approach smilar to following - www.develop1.net/.../Polymorphic-Workflow-Activity-Input-Arguments.aspx

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Workflow that e-mails N:N related users/accounts

    Hi Andrii! Sorry for the delay, had to get this toolkit approved. I'm looking at it now, and I'm slightly confused. What exactly is 'record' supposed to be on the distribute workflow process? I took a guess, but just getting a serialization error so I don't think I was right.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Workflow that e-mails N:N related users/accounts

    Hello,

    That's not possible with OOB workflows. What you can try is Distribute workflow step of github.com/.../releases toolkit. It can distribute child workflow across all entities that are in relationship with one you mentioned.

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans