Plugin for two entities RRS feed

  • Question

  • Hi there,

    I need to create a plugin which will be executed if there is any new insert in either Contact or in Account entity. So do i need to write 2 separate plugins for each entity?

    Thanks in advance!
    Thursday, July 23, 2009 7:05 PM


  • Hi.

    There are no need to create two plugin.

    You  can use following if statement in your plugin's code:

    if (context.PrimaryEntity == "account")
    //code for account creation handling
    else if (context.PrimaryEntity == "contact")
    //code for contact creation handling
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    • Proposed as answer by Nishant RanaMVP Friday, July 24, 2009 4:43 AM
    • Marked as answer by LearnQuick Friday, July 24, 2009 12:54 PM
    Thursday, July 23, 2009 9:08 PM