locked
Plugin Step Assign Message - No Assignee input parameter RRS feed

  • Question

  • I have created an Account plugin which has a step registered for the Assign message (pre-operation). The Plugin fires when I re-assign an account, but it appears there is no Assignee inputparameter.

    CRM 2013 online

    if(context.InputParameters.Contains("Assignee")) -- This returns false.

    I am able to grab my entity from the context.

    Everything I've read says I should be able to get an entity reference from the Assignee but no luck.

    Any ideas.

    Wednesday, June 4, 2014 8:47 PM

Answers

  • I'm not aware of any reason why the Assignee shouldn't be present in the InputParameters

    It's worth checking that the plugin is firing on the Assign message (it may be that you have registered the plugin on other messages as well) - you can get this in code from the IPluginExecutionContext.MessageName property.


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Marked as answer by mhlay Thursday, June 5, 2014 4:40 PM
    Thursday, June 5, 2014 11:02 AM
    Moderator

All replies

  • Hi,

    If you want to get entity from input parameter then use:

    // The InputParameters collection contains all the data passed in the message request.
    if (context.InputParameters.Contains("Target") &&
        context.InputParameters["Target"] is Entity)
    {
        // Obtain the target entity from the input parameters.
        Entity entity = (Entity)context.InputParameters["Target"];

    See this link: http://msdn.microsoft.com/en-us/library/gg309673.aspx

    There are plenty of examples in CRM SDK as well. Download it based on the CRM version you are using from MS site.

    hope this helps.

    H.Desai


    • Edited by H.Desai Thursday, June 5, 2014 4:28 AM
    Thursday, June 5, 2014 4:28 AM
  • I'm not aware of any reason why the Assignee shouldn't be present in the InputParameters

    It's worth checking that the plugin is firing on the Assign message (it may be that you have registered the plugin on other messages as well) - you can get this in code from the IPluginExecutionContext.MessageName property.


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Marked as answer by mhlay Thursday, June 5, 2014 4:40 PM
    Thursday, June 5, 2014 11:02 AM
    Moderator
  • Yep. Wasn't firing on Assign Message. Fixed and working now.

    Thanks

    Thursday, June 5, 2014 4:41 PM