Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to add records to related entity in workflow

(0) ShareShare
ReportReport
Posted on by 2

Dear reader,

ever had that feeling that your quest is a common one, but you just don't see where to find the solution?

We have entity projects. Related (n:n) to projects are systemusers.
Whenever a new systemuser is created, I need to be sure that it's added to 4 or 5 specific projects. Since this is very important, we can't rely on manual action. So there I was, looking for a workflow solution.
Without any doubt this question has been answered a thousand times, but to google without the right keywords is like searching in the dark with a magnifying glass.

Any ideas?

thanks in advance
(sorry in advance ;) )

Jeroen

*This post is locked for comments

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: How to add records to related entity in workflow

    Hi Jeroen,

    When you create N:N relationship between entities, it creates an internal system entity to store the references for both the entities involved. This internal entity is not accessible in workflows. You won't be able to create record. As suggested above, this can be achieved by custom code (Plugins & workflows).

    The other alternate is to create you own custom/ manual N:N entity by creating an entity with the fields from both the entities. As this is the normal entity, you can easily create records for this using workflow.

  • khoait Profile Picture
    450 on at
    RE: How to add records to related entity in workflow

    Yes, you can add the new systemuser to one single project using workflow with the help from a custom workflow activity. You may need to create a custom workflow activity which takes a project as an EntityReference input parameter, may be a user as an EntityReference input parameter if you want to use the custom workflow elsewhere other than the workflow on User; and perform Association between the project and the user.

    Or you can use available workflow tools from msdyncrmworkflowtools.codeplex.com which already implement a custom workflow activity called "Associate" to associate N:N relationship records.

  • Jeroen J Profile Picture
    2 on at
    RE: How to add records to related entity in workflow

    Okay, thanks for your quick (!) response.

    But what if I manage to get things simpler. What if I just need to add the new systemuser to one single project? Could that be done using workflow?

  • Community Member Profile Picture
    on at
    RE: How to add records to related entity in workflow

    Hi Jeroen,

    to deal with N:N relations you need to use a custom workflow or plugin.

    Within a plugin is not hard to reach your goal.

    Please le me know if i can help you.

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna, ITALY

    Independent Contractor

    http://www.francescopicchi.com

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,118 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans