locked
Problem converting PreSetState callout event to Plugins for opportunity entity RRS feed

  • Question

  •  

    Hi,

    In CRM 3.o callouts PreSetState Event had folowing signature..

    public override PreCalloutReturnValue PreSetState(

    CalloutUserContext userContext,

    CalloutEntityContext entityContext,

    ref int newStateCode,

    ref int newStatusCode,

    ref string errorMessage)

     

     

    I am migrating the same functionality to plugins, my problem is I am not getting the attributes  "newStateCode" and "newStatusCode" values in the plugins.

     I have registered following Plugin events for Opportunity SetState, SetStateDynamicEntity, Win and Lose.

     

    The logig I am trying to convert to plugin has lot of dependency on the values which I was getting from attributes  "newStateCode" and "newStatusCode" in callouts.

     

    Also I am struggling with the values for errorMessage attribute present in callouts to be handled in Plugins I am not getting errorMessage attribute in Plugins and my code has a logic to work on the condition such as "

     if (errorMessage == null ){ do this;}

     

    Appreciate help...

     

    Vijayendra

    Tuesday, July 8, 2008 5:29 PM

Answers

  • You can get these values from the State and Status InputParameters - although the State is the text string, rather than the integer value, and State is not passed on the Win or Lose messages. See http://mscrmuk.blogspot.com/2008/06/plugin-parameters.html for more information.

     

    Can you not just declare your own errorMessage variable, as the errorMessage was normally used only to set values, not to read the incoming value. If you do need to pass information between plugins you need to use the SharedVariables property bag

     

    Tuesday, July 8, 2008 6:52 PM
    Moderator

All replies

  • You can get these values from the State and Status InputParameters - although the State is the text string, rather than the integer value, and State is not passed on the Win or Lose messages. See http://mscrmuk.blogspot.com/2008/06/plugin-parameters.html for more information.

     

    Can you not just declare your own errorMessage variable, as the errorMessage was normally used only to set values, not to read the incoming value. If you do need to pass information between plugins you need to use the SharedVariables property bag

     

    Tuesday, July 8, 2008 6:52 PM
    Moderator
  •  

    Thanks David for your response.. I was able to solve errormessage problem based on your answer .. and  working on Plugins solution for
    attributes  "newStateCode" and "newStatusCode" in PreSetState callouts.
    Friday, July 11, 2008 6:22 AM