locked
Plugin Messages - How to fire a plugin for a 1:N relationship? RRS feed

  • Question

  • Hi all -

    I've gotten the routine down for firing a plugin when one entity record is attached to/detached from another where the relationship involved is an N:N relationship, using the Associate and Disassociate plugin messages.  The same sort of logic does *not* work where the relationship type is a 1:N relationship.

    No error message - simply, nothing happens! 

    How to fire a plugin when a record is associated using a 1:N relationship?  The logic I'll need to use will be very similar, so that won't be difficult.  Just can't get the ball rolling.

    Thanks!

    Rusty

    Tuesday, August 14, 2012 6:56 AM

Answers

  • Hi Rusty,

    Suppose you are adding a Contact to an Account's 1:N relationship, you need to register a plugin on the Create and Update of the Contact entity and look for changes to the parentcustomerid field.

    So, there isn't a specific message step to register, the asspciate/disassociate just looks like an Update to the child record.

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Marked as answer by RCisney Tuesday, August 14, 2012 7:31 AM
    Tuesday, August 14, 2012 7:14 AM
    Answerer

All replies

  • Hi Rusty,

    Suppose you are adding a Contact to an Account's 1:N relationship, you need to register a plugin on the Create and Update of the Contact entity and look for changes to the parentcustomerid field.

    So, there isn't a specific message step to register, the asspciate/disassociate just looks like an Update to the child record.

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Marked as answer by RCisney Tuesday, August 14, 2012 7:31 AM
    Tuesday, August 14, 2012 7:14 AM
    Answerer
  • Thanks, Scott.   I'll check that out.  So, create/Update on the "N" entity of the relationship. 

      
    Tuesday, August 14, 2012 7:21 AM
  • Yes, that's right.

    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Tuesday, August 14, 2012 7:26 AM
    Answerer
  • Scott - that did the trick. 

    Thanks for the tip.

    Its always good to know there is a community of users surrounding Dynamics CRM, that you can *usually* get a question answered from some corner of planet earth 24/7...   :)

    Have a great day.

    Tuesday, August 14, 2012 7:30 AM