Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Triggering a plugin for one-to-many relationships

Posted on by 676

Hi,

How can I trigger a plugin for a parental relationship, that is when child entities are added in a sub-grid from within the parent itself. Say for example adding a contact to an account. 

Any suggestions are most welcomed. 

*This post is locked for comments

  • Suggested answer
    BJMcmullan Profile Picture
    BJMcmullan 720 on at
    RE: Triggering a plugin for one-to-many relationships

    You could add a flag field on the contact and map it from Accounts so only contact made from Quick Create off of Accounts would have it populated.  Then check to see if the flag is populated before you run your Contact Creation from Account workflow.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Triggering a plugin for one-to-many relationships

    You need to put a check to see if the lookup of account is null or not in your code. If it's not null then contact is created from account

  • Mohd Tahir Profile Picture
    Mohd Tahir 676 on at
    RE: Triggering a plugin for one-to-many relationships

    Hi Inogic,

    But if I register a plugin to fire on create of Contact then it would fire on every contact creation? I just want to fire it when a contact is created from within an account.

  • Inogic Profile Picture
    Inogic 24,094 on at
    RE: Triggering a plugin for one-to-many relationships

    From your requirement it seems that you want to register a plugin to fire on create of child record.

    So as explained you can register a plugin on create of Contact record and then check the parent lookup value so that you get the value and perform your operations.

    Thanks!

  • Suggested answer
    BJMcmullan Profile Picture
    BJMcmullan 720 on at
    RE: Triggering a plugin for one-to-many relationships

    There's a number of Workflow Plugins that allow you to create One-to-Many workflows.  The one that I've used often is included in the Gap Consulting Workflow Essentials pack:

    www.gapconsulting.co.uk/.../workflow-essentials

    Once you install it, look under the Record tools, and you'll see the One-to-Many workflow step.  You'll just need to note the Entity and Relationship it should traverse and what workflow you'll want to run on it.

    Codeplex has a number of options to as well.  I just like the Gap one because it contains a number of other helpful workflow tools.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans