locked
How to Retrieve EntityMoniker object in the plugin and to which message i need to register the plugin(SetState or SetStateDynamicEntity or both). RRS feed

  • Question

  • Hi ,

    I need to write on plugin on Contact State Change.

    Which event do i need to register the plugin.

    How to Retrieve EntityMoniker object in the plugin and to which message i need to register the plugin(SetState or SetStateDynamicEntity or both).

    Regards,

    Abhishek Jain

    Monday, May 14, 2012 6:12 AM

Answers

  • When you open a form and deactivate the record, it is the SetStateDynamicEntity that is called. You can register it on both events SetStateDynamic and SetState but only one of them is called at a time.

    EntityMoniker is nothing but EntityReference and to read the entitymoniker you can use

    EntityReference ref = context.InputParamters["EntityMoniker"] as EntityReference.

    The entity reference will provide you with the Guid and Object type code of the entity which with it is associated.

    HTH

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Proposed as answer by Sam - Inogic Monday, May 14, 2012 6:48 AM
    • Marked as answer by Abhishek Jai Monday, May 14, 2012 7:06 AM
    Monday, May 14, 2012 6:48 AM

All replies

  • When you open a form and deactivate the record, it is the SetStateDynamicEntity that is called. You can register it on both events SetStateDynamic and SetState but only one of them is called at a time.

    EntityMoniker is nothing but EntityReference and to read the entitymoniker you can use

    EntityReference ref = context.InputParamters["EntityMoniker"] as EntityReference.

    The entity reference will provide you with the Guid and Object type code of the entity which with it is associated.

    HTH

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Proposed as answer by Sam - Inogic Monday, May 14, 2012 6:48 AM
    • Marked as answer by Abhishek Jai Monday, May 14, 2012 7:06 AM
    Monday, May 14, 2012 6:48 AM
  • Hi,

    Use SetStateDynamicEntity

     EntityReference  setstatus = (EntityReference)context.InputParameters["EntityMoniker"]

    Thanks


    Jhansi

    • Proposed as answer by Sri_S Monday, May 14, 2012 6:58 AM
    Monday, May 14, 2012 6:50 AM